fix(bugseti): handle silent git fetch failure in submit.go
Capture and log the error from `git fetch origin` in createBranch() instead of silently ignoring it. Warns the user they may be proceeding with stale data if the fetch fails. Fixes #62 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5e953944f5
commit
9319015219
1 changed files with 3 additions and 1 deletions
|
|
@ -177,7 +177,9 @@ func (s *SubmitService) createBranch(workDir, branch string) error {
|
||||||
// Fetch latest from upstream
|
// Fetch latest from upstream
|
||||||
cmd := exec.CommandContext(ctx, "git", "fetch", "origin")
|
cmd := exec.CommandContext(ctx, "git", "fetch", "origin")
|
||||||
cmd.Dir = workDir
|
cmd.Dir = workDir
|
||||||
cmd.Run() // Ignore errors
|
if err := cmd.Run(); err != nil {
|
||||||
|
log.Printf("WARNING: git fetch origin failed in %s: %v (proceeding with potentially stale data)", workDir, err)
|
||||||
|
}
|
||||||
|
|
||||||
// Create and checkout new branch
|
// Create and checkout new branch
|
||||||
cmd = exec.CommandContext(ctx, "git", "checkout", "-b", branch)
|
cmd = exec.CommandContext(ctx, "git", "checkout", "-b", branch)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue