summaryrefslogtreecommitdiff
path: root/internal/sync/branch_sync.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-11 18:34:32 +0200
committerPaul Buetow <paul@buetow.org>2026-03-11 18:34:32 +0200
commit9570df7b5426b50c4256d0804cc8a30b14d77039 (patch)
treeadafdb51b9a3b76f3fe015728ecd3bbd69df14ac /internal/sync/branch_sync.go
parent9706e53620045c20bf732054a286183c70f77581 (diff)
fix(sync): stop relying on process cwd
Diffstat (limited to 'internal/sync/branch_sync.go')
-rw-r--r--internal/sync/branch_sync.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/sync/branch_sync.go b/internal/sync/branch_sync.go
index eafb551..a667ee2 100644
--- a/internal/sync/branch_sync.go
+++ b/internal/sync/branch_sync.go
@@ -24,7 +24,7 @@ func (s *Syncer) trackRemotesWithBranch(branch string, remotes map[string]*confi
}
// mergeFromRemotes merges changes from all remotes that have the branch
-func mergeFromRemotes(branch string, remotesWithBranch map[string]bool) error {
+func mergeFromRemotes(repoPath, branch string, remotesWithBranch map[string]bool) error {
if len(remotesWithBranch) == 0 {
fmt.Printf(" Branch %s is local only, will push to all remotes\n", branch)
return nil
@@ -32,7 +32,7 @@ func mergeFromRemotes(branch string, remotesWithBranch map[string]bool) error {
// Merge changes from all remotes that have this branch
for remoteName := range remotesWithBranch {
- if err := mergeBranch(remoteName, branch); err != nil {
+ if err := mergeBranch(repoPath, remoteName, branch); err != nil {
return err
}
}
@@ -41,7 +41,7 @@ func mergeFromRemotes(branch string, remotesWithBranch map[string]bool) error {
}
// pushToAllRemotes pushes the branch to all configured remotes
-func pushToAllRemotes(branch string, remotes map[string]*config.Organization, remotesWithBranch map[string]bool) error {
+func pushToAllRemotes(repoPath, branch string, remotes map[string]*config.Organization, remotesWithBranch map[string]bool) error {
for remoteName, org := range remotes {
// Check if this remote has the branch
remoteHasBranch := remotesWithBranch[remoteName]
@@ -52,7 +52,7 @@ func pushToAllRemotes(branch string, remotes map[string]*config.Organization, re
fmt.Printf(" Pushing to %s (%s)...\n", remoteName, org.Host)
}
- if err := pushBranchWithBackupSupport(remoteName, branch, remoteHasBranch, org); err != nil {
+ if err := pushBranchWithBackupSupport(repoPath, remoteName, branch, remoteHasBranch, org); err != nil {
return err
}
}