fix: Do not use name head for source remote#6010
Merged
lukemassa merged 1 commit intorunatlantis:mainfrom Dec 6, 2025
Merged
Conversation
Signed-off-by: Luke Massa <lukefrederickmassa@gmail.com>
head for source remotehead for source remote
jamengual
approved these changes
Dec 6, 2025
This was referenced Jan 6, 2026
aidansteele
pushed a commit
to aidansteele/atlantis
that referenced
this pull request
Mar 12, 2026
Signed-off-by: Luke Massa <lukefrederickmassa@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
Use
sourceinstead ofheadas name of remote corresponding to the source repo of the PR.why
It was originally called
headbecause that's what github calls it. However, the term head is overloaded in git. Specifically, if you call a remoteheadit can lead to ambiguities where git can't determine the right ref forHEAD.Note this has nothing to do w github or Atlantis, this is just a fact about the way git resolves short names.
This is because
rev-parseattempts to resolve branches and remotes, and is not case sensitive.We've used
headfor a while, but only recently #5895 did we start to rely on HEAD being correct after a fetch. It's perfectly legal to have a remote called head, and it doesn't cause a problem until you rungit fetch headorgit fetch --all. At that point, you have aHEADref in theheadremote. Subsequently, calls togit rev-parse HEAD(which are needed by the new logic to determine if you're on the right branch or not) are ambiguous.The specific place where this is biting us now is determining the current ref uses combined output, so it includes this warning. We should probably fix that separately.
tests
Before:
After:
references
Closes: #6009