aboutsummaryrefslogtreecommitdiffstats
path: root/worktree.go
diff options
context:
space:
mode:
authorAlexey Smirnov <unlinkat@gmail.com>2019-02-07 14:48:32 +0500
committerAlexey Smirnov <unlinkat@gmail.com>2019-02-07 14:48:32 +0500
commitcf6cf0d4b77386acbc4b742ab2cb471b2206f5ae (patch)
tree494c22eb8c3b678e2f926614ef7d54fa46cbf663 /worktree.go
parent00629a1f26e668d0da503455e2a61d7107da3160 (diff)
downloadgo-git-cf6cf0d4b77386acbc4b742ab2cb471b2206f5ae.tar.gz
worktree: add sentinel error for non-fast-forward pull
Signed-off-by: Alexey Smirnov <unlinkat@gmail.com>
Diffstat (limited to 'worktree.go')
-rw-r--r--worktree.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/worktree.go b/worktree.go
index e45d815..a14fd8d 100644
--- a/worktree.go
+++ b/worktree.go
@@ -25,10 +25,11 @@ import (
)
var (
- ErrWorktreeNotClean = errors.New("worktree is not clean")
- ErrSubmoduleNotFound = errors.New("submodule not found")
- ErrUnstagedChanges = errors.New("worktree contains unstaged changes")
- ErrGitModulesSymlink = errors.New(gitmodulesFile + " is a symlink")
+ ErrWorktreeNotClean = errors.New("worktree is not clean")
+ ErrSubmoduleNotFound = errors.New("submodule not found")
+ ErrUnstagedChanges = errors.New("worktree contains unstaged changes")
+ ErrGitModulesSymlink = errors.New(gitmodulesFile + " is a symlink")
+ ErrNonFastForwardUpdate = errors.New("non-fast-forward update")
)
// Worktree represents a git worktree.
@@ -101,7 +102,7 @@ func (w *Worktree) PullContext(ctx context.Context, o *PullOptions) error {
}
if !ff {
- return fmt.Errorf("non-fast-forward update")
+ return ErrNonFastForwardUpdate
}
}