aboutsummaryrefslogtreecommitdiffstats
path: root/bug
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2020-10-04 20:09:36 +0200
committerGitHub <noreply@github.com>2020-10-04 20:09:36 +0200
commitd56ce3d5d9f5ef74201a8ee7c25be4820d435b47 (patch)
tree4382550c1e8387b7cb6b13c6dd32508c24e6c4ca /bug
parent9bc2483df054387c1241b2e1644ab7e6e9bc4e9a (diff)
parent1eb13173183cf402e4197be51935a4b3ddacf256 (diff)
downloadgit-bug-d56ce3d5d9f5ef74201a8ee7c25be4820d435b47.tar.gz
Merge pull request #460 from MichaelMure/fix-push
repo: use go-git in more places, fix push
Diffstat (limited to 'bug')
-rw-r--r--bug/bug_actions.go6
-rw-r--r--bug/bug_test.go6
-rw-r--r--bug/operation_test.go2
3 files changed, 9 insertions, 5 deletions
diff --git a/bug/bug_actions.go b/bug/bug_actions.go
index cb0d0f7d..f99f83ad 100644
--- a/bug/bug_actions.go
+++ b/bug/bug_actions.go
@@ -12,6 +12,7 @@ import (
// Fetch retrieve updates from a remote
// This does not change the local bugs state
func Fetch(repo repository.Repo, remote string) (string, error) {
+ // "refs/bugs/*:refs/remotes/<remote>>/bugs/*"
remoteRefSpec := fmt.Sprintf(bugsRemoteRefPattern, remote)
fetchRefSpec := fmt.Sprintf("%s*:%s*", bugsRefPattern, remoteRefSpec)
@@ -20,7 +21,10 @@ func Fetch(repo repository.Repo, remote string) (string, error) {
// Push update a remote with the local changes
func Push(repo repository.Repo, remote string) (string, error) {
- return repo.PushRefs(remote, bugsRefPattern+"*")
+ // "refs/bugs/*:refs/bugs/*"
+ refspec := fmt.Sprintf("%s*:%s*", bugsRefPattern, bugsRefPattern)
+
+ return repo.PushRefs(remote, refspec)
}
// Pull will do a Fetch + MergeAll
diff --git a/bug/bug_test.go b/bug/bug_test.go
index 400e50f8..ac7da693 100644
--- a/bug/bug_test.go
+++ b/bug/bug_test.go
@@ -117,9 +117,9 @@ func equivalentBug(t *testing.T, expected, actual *Bug) {
}
func TestBugRemove(t *testing.T) {
- repo := repository.CreateTestRepo(false)
- remoteA := repository.CreateTestRepo(true)
- remoteB := repository.CreateTestRepo(true)
+ repo := repository.CreateGoGitTestRepo(false)
+ remoteA := repository.CreateGoGitTestRepo(true)
+ remoteB := repository.CreateGoGitTestRepo(true)
defer repository.CleanupTestRepos(repo, remoteA, remoteB)
err := repo.AddRemote("remoteA", "file://"+remoteA.GetPath())
diff --git a/bug/operation_test.go b/bug/operation_test.go
index 285bdbd6..21ae5eff 100644
--- a/bug/operation_test.go
+++ b/bug/operation_test.go
@@ -79,7 +79,7 @@ func TestMetadata(t *testing.T) {
}
func TestID(t *testing.T) {
- repo := repository.CreateTestRepo(false)
+ repo := repository.CreateGoGitTestRepo(false)
defer repository.CleanupTestRepos(repo)
repos := []repository.ClockedRepo{