aboutsummaryrefslogtreecommitdiffstats
path: root/worktree.go
diff options
context:
space:
mode:
Diffstat (limited to 'worktree.go')
-rw-r--r--worktree.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/worktree.go b/worktree.go
index 7f394d4..d272373 100644
--- a/worktree.go
+++ b/worktree.go
@@ -93,10 +93,16 @@ func (w *Worktree) PullContext(ctx context.Context, o *PullOptions) error {
head, err := w.r.Head()
if err == nil {
- if !updated && head.Hash() == ref.Hash() {
+ headAheadOfRef,err := isFastForward(w.r.Storer, ref.Hash(), head.Hash())
+ if err != nil {
+ return err
+ }
+
+ if !updated && headAheadOfRef {
return NoErrAlreadyUpToDate
}
+
ff, err := isFastForward(w.r.Storer, head.Hash(), ref.Hash())
if err != nil {
return err