Skip to content

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
// Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
// "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.

return !!output.stdout.trim();
});
}
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

4 participants