-
Notifications
You must be signed in to change notification settings - Fork 68
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 git clone & update helper scripts #993
Conversation
1ddc15d
to
833e806
Compare
833e806
to
4f89f6e
Compare
if [ "$("@GIT_EXECUTABLE@" cat-file -t @BRANCH@)" = tag ]; then | ||
"@GIT_EXECUTABLE@" checkout @BRANCH@ | ||
else | ||
"@GIT_EXECUTABLE@" checkout origin/@BRANCH@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the local branch refs/heads/@BRANCH@
will still be created with upstream information (but not checked out); this is because of clone -b
.
So the logic is:
|
|
Right.. |
LGTM 👍 |
Fix git clone & update helper scripts
Interesting detail: this will fail if someone was to make a lightweight (old-style) tag instead of the new, preferred annotated tags (git tag -a). Apparently came up today with VisTrails' tag for uvcdat-2.2.0. |
Creating local branches is a bit weird, and moving them is definitely not a good idea.
This places Git in "detached head" mode without creating or changing local branches. Remember that BRANCH might very well be a tag name.