Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Use FQRN to prevent errors when branch = label #1875

Merged
merged 1 commit into from
Mar 28, 2019

Conversation

hiddeco
Copy link
Member

@hiddeco hiddeco commented Mar 28, 2019

Fixes #1845

If the label and branch were set to the same name, Flux would not
create the sync tag as the revision lookup for HEAD and <tag>
returned the same revision.

This is due to how git looks up symbolic ref names, giving priority
to heads over tags. Using the (almost) fully qualified ref name will
tell git to only look for matches of that type.

https://git-scm.com/docs/gitrevisions#Documentation/gitrevisions.txt-emltrefnamegtemegemmasterememheadsmasterememrefsheadsmasterem

Copy link
Member

@squaremo squaremo left a comment

Choose a reason for hiding this comment

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

Looks OK to me. SyncRevision explicitly checks a tag; HeadRevision is only used to get the head of a branch, so although the meaning of the latter is slightly changed (as noted in a comment), I think it's safe to use the unambiguous names.

git/working.go Outdated Show resolved Hide resolved
If the label and branch were set to the same name, Flux would not
create the sync tag as the revision lookup for `HEAD` and `<tag>`
returned the same revision.

This is due to how git looks up symbolic ref names, giving priority
to heads over tags. Using the (almost) fully qualified ref name will
tell git to only look for matches of that type.

https://git-scm.com/docs/gitrevisions#Documentation/gitrevisions.txt-emltrefnamegtemegemmasterememheadsmasterememrefsheadsmasterem
@hiddeco hiddeco merged commit ef02165 into master Mar 28, 2019
@hiddeco hiddeco deleted the bug/1845-sync-label-branch branch March 28, 2019 15:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants