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 Extension] ApiRepositoryState.refs seem to contain a wrong commit hash #92146

Closed
ole1986 opened this issue Mar 6, 2020 · 5 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@ole1986
Copy link

ole1986 commented Mar 6, 2020

  • VSCode Version: 1.42.1
  • OS Version: Win 10 / Linux
  • Git CLI version: 2.11

Steps to Reproduce:

  1. mkdir testrepo && cd testrepo
  2. echo "testcontent" > testfile
  3. git add .
  4. git commit -a -m "initial commit"
  5. git log --oneline

Result:
e9cba6f (HEAD -> master) Initial commit

Adding a tag

  1. git tag -a 1.0.0 -m "Version 1.0.0"
  2. git log --oneline

Result:
e9cba6f (HEAD -> master, tag: 1.0.0) Initial commit

Calling extensions.getExtension<GitExtension>('vscode.git')!.exports.getAPI(1).repositories[0].state.refs returns the following:

[
    {
        "name": "master",
        "commit": "e9cba6fa041b7d8f53ce8365835695cee25be935",
        "type": 0
    },
    {
        "name": "1.0.0",
        "commit": "099eb26e234e6742bf000b756bc58ee8a8d4f8ba",
        "type": 2
    }
]

While commit "099eb26e234e6742bf000b756bc58ee8a8d4f8ba" does not exist in the repository

@ole1986
Copy link
Author

ole1986 commented Mar 6, 2020

Question is here if its intended to not have the annotation tag hash dereferenced

@joaomoreno
Copy link
Member

Great catch. We might have to replace this with:

git for-each-ref --format "%(refname) %(objectname) %(*objectname)"

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug git GIT issues help wanted Issues identified as good community contribution opportunities good first issue Issues identified as good for first-time contributors labels Apr 3, 2020
@stschoberg
Copy link

Hey João. I'd like to fix this. Seems like a trivial issue for a first time commit to the codebase.

@ole1986
Copy link
Author

ole1986 commented Nov 8, 2020

This is not yet included in the VSCode insiders preview, right?

@joaomoreno
Copy link
Member

Exactly, the bot will remove the unreleased label and add insiders-released when that happens.

@roblourens roblourens added the verified Verification succeeded label Dec 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug git GIT issues good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@joaomoreno @roblourens @ole1986 @stschoberg and others