mirror of
https://github.com/yarlson/lnk.git
synced 2025-09-01 18:02:34 +02:00
fix: remove hardcoded branch names from push/pull operations
- Remove hardcoded "main" branch from git push and pull commands - Let Git automatically detect and use current branch - Add comprehensive tests for different branch names (main, master, develop) - Fixes GitHub issue #14 where operations failed on repos using "master"
This commit is contained in:
@@ -437,7 +437,7 @@ func (g *Git) Push() error {
|
||||
return &PushError{Reason: err.Error(), Err: err}
|
||||
}
|
||||
|
||||
cmd := exec.Command("git", "push", "-u", "origin", "main")
|
||||
cmd := exec.Command("git", "push", "-u", "origin")
|
||||
cmd.Dir = g.repoPath
|
||||
|
||||
output, err := cmd.CombinedOutput()
|
||||
@@ -456,7 +456,7 @@ func (g *Git) Pull() error {
|
||||
return &PullError{Reason: err.Error(), Err: err}
|
||||
}
|
||||
|
||||
cmd := exec.Command("git", "pull", "origin", "main")
|
||||
cmd := exec.Command("git", "pull", "origin")
|
||||
cmd.Dir = g.repoPath
|
||||
|
||||
output, err := cmd.CombinedOutput()
|
||||
|
Reference in New Issue
Block a user