Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git Source Control Graph fails to load if branch is tracking another local branch #234396

Open
rkjnsn opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues

Comments

@rkjnsn
Copy link

rkjnsn commented Nov 22, 2024

In git, sometimes it is useful to have a local branch track another local branch. When such a branch is created, git will use the special value . for the remote field. E.g., if feature2 depends on feature1, I might set the feature2 branch to track the feature1 branch for ease of rebasing as I make adjustments to feature1. The resulting .git/config entry would look like this:

[branch "feature2"]
        remote = .
        merge = refs/heads/feature1

However, when I have the feature2 branch checked out, I see no history in the source control graph. Instead it tells me,

The selected source control provider does not have any source control history items.

Looking at the Git output panel, I see the following error:

fatal: bad revision 'refs/remotes/./feature1'

The problem seems to be that VS Code doesn't recognize that . is a special value meaning "the local repository", not the name of a remote.

The correct behavior would be instead to query refs/heads/feature1 when the remote is ..

Version: 1.95.3
Commit: f1a4fb1
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Embedder: server-distro

@lszomoru lszomoru added git GIT issues bug Issue identified by VS Code Team member as probable bug labels Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues
Projects
None yet
Development

No branches or pull requests

2 participants