aboutsummaryrefslogtreecommitdiffstats
path: root/repository
diff options
context:
space:
mode:
Diffstat (limited to 'repository')
-rw-r--r--repository/repo.go1
-rw-r--r--repository/repo_testing.go4
2 files changed, 5 insertions, 0 deletions
diff --git a/repository/repo.go b/repository/repo.go
index 8d162c6d..80bb7ce7 100644
--- a/repository/repo.go
+++ b/repository/repo.go
@@ -147,6 +147,7 @@ type RepoData interface {
UpdateRef(ref string, hash Hash) error
// RemoveRef will remove a Git reference
+ // RemoveRef is idempotent.
RemoveRef(ref string) error
// ListRefs will return a list of Git ref matching the given refspec
diff --git a/repository/repo_testing.go b/repository/repo_testing.go
index cdcb9008..1f80d898 100644
--- a/repository/repo_testing.go
+++ b/repository/repo_testing.go
@@ -202,6 +202,10 @@ func RepoDataTest(t *testing.T, repo RepoData) {
err = repo.RemoveRef("refs/bugs/ref1")
require.NoError(t, err)
+
+ // RemoveRef is idempotent
+ err = repo.RemoveRef("refs/bugs/ref1")
+ require.NoError(t, err)
}
func RepoDataSignatureTest(t *testing.T, repo RepoData) {