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
Collaborator

@ericsciple ericsciple commented Jan 2, 2020

fixes #121

dist/index.js Show resolved Hide resolved
@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
Collaborator Author

@ericsciple ericsciple Jan 2, 2020

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
Collaborator Author

@ericsciple ericsciple Jan 2, 2020

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"

Shabanfawaz
Copy link

Shabanfawaz commented on e5d5317 Jan 3, 2020

Choose a reason for hiding this comment

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

dist/index.js

@ericsciple ericsciple merged commit ae525b2 into master Jan 3, 2020
5 checks passed
@ericsciple ericsciple deleted the users/ericsciple/m164revparse branch Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants