From ce1fe93e0be5ab4716c0299a45226790afe045aa Mon Sep 17 00:00:00 2001 From: Andrii Kostenko Date: Fri, 19 Jan 2024 14:58:03 +0200 Subject: [PATCH 1/2] Correctly detect primary branch Signed-off-by: Andrii Kostenko --- ext/git/writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/git/writer.go b/ext/git/writer.go index 4dede583..48865681 100644 --- a/ext/git/writer.go +++ b/ext/git/writer.go @@ -93,7 +93,7 @@ func (m *nativeGitClient) Add(path string) error { // SymRefToBranch retrieves the branch name a symbolic ref points to func (m *nativeGitClient) SymRefToBranch(symRef string) (string, error) { - output, err := m.runCmd("symbolic-ref", symRef) + output, err := m.runCmd("symbolic-ref", "refs/remotes/origin/" + symRef) if err != nil { return "", fmt.Errorf("could not resolve symbolic ref '%s': %v", symRef, err) } From 43a70aff7556f71e28b0e37859f36aa8c07a4d53 Mon Sep 17 00:00:00 2001 From: Andrii Kostenko Date: Fri, 19 Jan 2024 14:58:14 +0000 Subject: [PATCH 2/2] fix lint Signed-off-by: Andrii Kostenko --- ext/git/writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/git/writer.go b/ext/git/writer.go index 48865681..c1096392 100644 --- a/ext/git/writer.go +++ b/ext/git/writer.go @@ -93,7 +93,7 @@ func (m *nativeGitClient) Add(path string) error { // SymRefToBranch retrieves the branch name a symbolic ref points to func (m *nativeGitClient) SymRefToBranch(symRef string) (string, error) { - output, err := m.runCmd("symbolic-ref", "refs/remotes/origin/" + symRef) + output, err := m.runCmd("symbolic-ref", "refs/remotes/origin/"+symRef) if err != nil { return "", fmt.Errorf("could not resolve symbolic ref '%s': %v", symRef, err) }