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

fix issue checking detached when git less than 2.22 #128

Merged
merged 4 commits into from
Jan 3, 2020

Conversation

ericsciple
Copy link
Contributor

fixes #121

@ericsciple ericsciple changed the title fix issue checking detached when git less than 2.22 [wip] fix issue checking detached when git less than 2.22 Jan 2, 2020
@ericsciple ericsciple changed the title [wip] fix issue checking detached when git less than 2.22 fix issue checking detached when git less than 2.22 Jan 2, 2020
// "branch --list" is more difficult when in a detached HEAD state.
const args = ['rev-parse', '--symbolic'];
// Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i ran into this bug in git 2.18 when testing. Switching to --symbolic-full-name and trimming refs/heads/ and refs/remotes/ from the output works around the issue.

@@ -4799,9 +4799,11 @@ class GitCommandManager {
branchList(remote) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useful script for testing:

      - run: |
          cd ..
          Invoke-WebRequest -Uri https://github.com/git-for-windows/git/releases/download/v2.18.0.windows.1/MinGit-2.18.0-64-bit.zip -OutFile mingit.zip
          mkdir mingit
          Expand-Archive -LiteralPath .\mingit.zip -DestinationPath .\mingit
          dir .\mingit
          echo "::add-path::$PWD\mingit\cmd"

@ericsciple ericsciple merged commit ae525b2 into master Jan 3, 2020
@ericsciple ericsciple deleted the users/ericsciple/m164revparse branch January 3, 2020 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Checkout@v2 use Git branch --show-current which requires git 2.22.0
3 participants