diff options
author | Aditya Sirish <aditya@saky.in> | 2023-10-12 00:15:14 -0400 |
---|---|---|
committer | Aditya Sirish <aditya@saky.in> | 2023-10-26 07:05:45 -0400 |
commit | 4862643548f115dff8d402faf610e50408458cdf (patch) | |
tree | 28a0f2150107c215c288f7d2126c16005c34f6db /remote.go | |
parent | f4b881ce59edb35afb6a375187953db5ea7cbd64 (diff) | |
download | go-git-4862643548f115dff8d402faf610e50408458cdf.tar.gz |
git: remote, flip branch check to not-tag check
In remote.updateLocalReferenceStorage, this commit updates a check to
see if the reference is for a branch (in refs/heads) to checking the
reference is not a tag. This change ensures that the subsequent
fast-forward only handling clauses apply to references that are not
standard branches stored in refs/heads.
Signed-off-by: Aditya Sirish <aditya@saky.in>
Diffstat (limited to 'remote.go')
-rw-r--r-- | remote.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1198,9 +1198,9 @@ func (r *Remote) updateLocalReferenceStorage( old, _ := storer.ResolveReference(r.s, localName) new := plumbing.NewHashReference(localName, ref.Hash()) - // If the ref exists locally as a branch and force is not specified, - // only update if the new ref is an ancestor of the old - if old != nil && old.Name().IsBranch() && !force && !spec.IsForceUpdate() { + // If the ref exists locally as a non-tag and force is not + // specified, only update if the new ref is an ancestor of the old + if old != nil && !old.Name().IsTag() && !force && !spec.IsForceUpdate() { ff, err := isFastForward(r.s, old.Hash(), new.Hash()) if err != nil { return updated, err |