aboutsummaryrefslogtreecommitdiffstats
path: root/repository
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-10-04 19:56:16 +0200
committerMichael Muré <batolettre@gmail.com>2020-10-04 19:56:16 +0200
commit1a0c86a12d68a2f0ee99cbff535c82e07b735108 (patch)
treecd83782c576f2869555913d753de1351ff94a547 /repository
parent9bc2483df054387c1241b2e1644ab7e6e9bc4e9a (diff)
downloadgit-bug-1a0c86a12d68a2f0ee99cbff535c82e07b735108.tar.gz
repo: use go-git in more places, fix push
Diffstat (limited to 'repository')
-rw-r--r--repository/git_testing.go6
-rw-r--r--repository/gogit.go6
2 files changed, 9 insertions, 3 deletions
diff --git a/repository/git_testing.go b/repository/git_testing.go
index 7d40bf1f..874cc86c 100644
--- a/repository/git_testing.go
+++ b/repository/git_testing.go
@@ -44,9 +44,9 @@ func CreateTestRepo(bare bool) TestedRepo {
}
func SetupReposAndRemote() (repoA, repoB, remote TestedRepo) {
- repoA = CreateTestRepo(false)
- repoB = CreateTestRepo(false)
- remote = CreateTestRepo(true)
+ repoA = CreateGoGitTestRepo(false)
+ repoB = CreateGoGitTestRepo(false)
+ remote = CreateGoGitTestRepo(true)
remoteAddr := "file://" + remote.GetPath()
diff --git a/repository/gogit.go b/repository/gogit.go
index b907c070..8fb7c52a 100644
--- a/repository/gogit.go
+++ b/repository/gogit.go
@@ -276,6 +276,9 @@ func (repo *GoGitRepo) FetchRefs(remote string, refSpec string) (string, error)
RefSpecs: []config.RefSpec{config.RefSpec(refSpec)},
Progress: buf,
})
+ if err == gogit.NoErrAlreadyUpToDate {
+ return "already up-to-date", nil
+ }
if err != nil {
return "", err
}
@@ -292,6 +295,9 @@ func (repo *GoGitRepo) PushRefs(remote string, refSpec string) (string, error) {
RefSpecs: []config.RefSpec{config.RefSpec(refSpec)},
Progress: buf,
})
+ if err == gogit.NoErrAlreadyUpToDate {
+ return "already up-to-date", nil
+ }
if err != nil {
return "", err
}