Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 04852d2

Browse files
committed
Fetch - honor per refspec force flag
1 parent 567d2dc commit 04852d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

remote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ func (r *Remote) updateLocalReferenceStorage(
724724

725725
// If the ref exists locally as a branch and force is not specified,
726726
// only update if the new ref is an ancestor of the old
727-
if old != nil && old.Name().IsBranch() && !force {
727+
if old != nil && old.Name().IsBranch() && !force && !spec.IsForceUpdate() {
728728
ff, err := isFastForward(r.s, old.Hash(), new.Hash())
729729
if err != nil {
730730
return updated, err

0 commit comments

Comments
 (0)