aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/storer
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-11-29 12:22:37 +0100
committerGitHub <noreply@github.com>2017-11-29 12:22:37 +0100
commitc07c778ed043429427533e2fd7549a3d54b903f1 (patch)
tree9fbd8da724791193905635a4ed789c6ddf8f39c5 /plumbing/storer
parent6dda959c4bda3a422a9a1c6425f92efa914c4d82 (diff)
parentcbab840ef28888c2e85112b3b48294f7333ec187 (diff)
downloadgo-git-c07c778ed043429427533e2fd7549a3d54b903f1.tar.gz
Merge pull request #665 from keybase/strib/gh-fast-forward-fetch
remote: support for non-force, fast-forward-only fetches
Diffstat (limited to 'plumbing/storer')
-rw-r--r--plumbing/storer/reference.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/plumbing/storer/reference.go b/plumbing/storer/reference.go
index 5c21f23..ae80a39 100644
--- a/plumbing/storer/reference.go
+++ b/plumbing/storer/reference.go
@@ -16,6 +16,11 @@ var ErrMaxResolveRecursion = errors.New("max. recursion level reached")
// ReferenceStorer is a generic storage of references.
type ReferenceStorer interface {
SetReference(*plumbing.Reference) error
+ // CheckAndSetReference sets the reference `new`, but if `old` is
+ // not `nil`, it first checks that the current stored value for
+ // `old.Name()` matches the given reference value in `old`. If
+ // not, it returns an error and doesn't update `new`.
+ CheckAndSetReference(new, old *plumbing.Reference) error
Reference(plumbing.ReferenceName) (*plumbing.Reference, error)
IterReferences() (ReferenceIter, error)
RemoveReference(plumbing.ReferenceName) error