diff options
author | Michael Muré <batolettre@gmail.com> | 2020-10-04 19:56:16 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-10-04 19:56:16 +0200 |
commit | 1a0c86a12d68a2f0ee99cbff535c82e07b735108 (patch) | |
tree | cd83782c576f2869555913d753de1351ff94a547 /repository | |
parent | 9bc2483df054387c1241b2e1644ab7e6e9bc4e9a (diff) | |
download | git-bug-1a0c86a12d68a2f0ee99cbff535c82e07b735108.tar.gz |
repo: use go-git in more places, fix push
Diffstat (limited to 'repository')
-rw-r--r-- | repository/git_testing.go | 6 | ||||
-rw-r--r-- | repository/gogit.go | 6 |
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 } |