diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2020-06-24 05:39:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-24 05:39:18 +0200 |
commit | 9ac753f4afb36feb1a1c22214c16e853db54aa00 (patch) | |
tree | 4a8c9ab3e3ef1676e4cf120beb7e25aac8855b05 /worktree.go | |
parent | 16918a5be9a2076bbb686b2580da1988d557da6d (diff) | |
parent | 23e21f0cfc6196d5dce8fc20af0ecc9701aabe4f (diff) | |
download | go-git-9ac753f4afb36feb1a1c22214c16e853db54aa00.tar.gz |
Merge pull request #109 from mruediger/master
Worktre: Pull, report "Already up to date" when local repository ahead of remote
Diffstat (limited to 'worktree.go')
-rw-r--r-- | worktree.go | 8 |
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 |