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

add double dash to move to another branch, not reset file/directory in git client #143

Merged
merged 1 commit into from
May 21, 2020

Conversation

firemark
Copy link
Contributor

This bug occurs only when you have file and branch on remote with the same name, because if git checkout don't find local branch then resets file with this name.

How to reproduce

  1. Make a file foo and commit it
  2. Make a branch foo and push it to remote
  3. Use vcs tool with config:
repositories:
  repo:
    type: git
    url: git@gitlab.com:foo/bar/repo.git
    version: foo
  1. In results, downloaded repository has branch master not foo

Solution

According to https://git-scm.com/docs/git-checkout adds a double dash is enough

PS. thanks to @ksuszka to found the bug!

@dirk-thomas
Copy link
Owner

Thank you for the patch.

@dirk-thomas dirk-thomas added this to the 0.2.10 milestone May 21, 2020
@dirk-thomas dirk-thomas merged commit 9de5d88 into dirk-thomas:master May 21, 2020
@dirk-thomas
Copy link
Owner

See #164 which reports that this breaks with older git versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants