Skip to content

Commit

Permalink
🐛 Changed from checkout -f to reset --hard to match fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
kalebo committed Aug 22, 2017
1 parent a9ccd75 commit 32e02a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func updateRepo(gitDir string, workTree string) error {
// N.B., that git must have a ssh key
statusCmd := exec.Command("git", "status", "-s")
pullCmd := exec.Command("git", "fetch")
checkoutCmd := exec.Command("git", "checkout", "-f", "master")
checkoutCmd := exec.Command("git", "reset", "--hard", "origin/master")

statusCmd.Env = env
pullCmd.Env = env
Expand All @@ -127,7 +127,7 @@ func updateRepo(gitDir string, workTree string) error {

// Checkout master
if output, err := checkoutCmd.CombinedOutput(); err != nil {
glog.Errorf("Error running `git checkout -f master` for %s in %s: %s", gitDir, workTree, output)
glog.Errorf("Error running `git reset --hard origin/master` for %s in %s: %s", gitDir, workTree, output)
return errors.New("checkout failed")
}

Expand Down

0 comments on commit 32e02a6

Please sign in to comment.