Skip to content

Commit

Permalink
fix bit sync pulling even when force push fails (e.g. when there's a …
Browse files Browse the repository at this point in the history
…protected branch)
  • Loading branch information
chriswalz committed Mar 18, 2021
1 parent e9b67f1 commit 966b3c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ sync local-branch
RunInTerminalWithColor("git", []string{"pull", "-r", upstream, currentBranch})
return
} else if ans == optionMap["force"] {
RunInTerminalWithColor("git", []string{"push", upstream, currentBranch, "--force-with-lease"})
err := RunInTerminalWithColor("git", []string{"push", upstream, currentBranch, "--force-with-lease"})
if err != nil {
fmt.Println("Force push failed")
fmt.Println(err)
return
}
// dont return user may have additional changes to save
} else {
fmt.Println("Canceling...")
Expand Down

0 comments on commit 966b3c4

Please sign in to comment.