From 77547cedce852cf624b50603821709c11da0355c Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Wed, 9 Oct 2024 18:57:25 +0000 Subject: [PATCH] fix(client): set push.default=current for git --- client/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index cd3043f..ef57f4e 100644 --- a/client/client.go +++ b/client/client.go @@ -198,9 +198,11 @@ func (c Client) PushRepo(repo api.Repo) (err error) { remote := fmt.Sprintf("git://%s/%s", addr, repo.Name) log.Debug().Msgf("git proxy remote: %v", remote) - raw, err := exec.Command("git", "--work-tree", repo.Path, "push", "--force", remote). + raw, err := exec.Command("git", "-c", "push.default=current", + "--work-tree", repo.Path, "push", "--force", remote). CombinedOutput() if err != nil { + log.Error().Msgf("push repo %v\n%v", repo, string(raw)) return }