Skip to content

Commit

Permalink
Exit out of updateLocalRepo on stash and checkout errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xbglowx committed Nov 11, 2021
1 parent 1efcbfb commit ae7f73f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/github-org-sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func (gh *GhOrgSync) updateLocalRepo(sem chan struct{}, repo *github.Repository)
err := cmd.Run()
if err != nil {
fmt.Printf("ERROR: Repo %s is dirty but failed to stash: %s\n", repo.GetName(), err)
return
}
}

Expand All @@ -129,6 +130,7 @@ func (gh *GhOrgSync) updateLocalRepo(sem chan struct{}, repo *github.Repository)
err := cmd.Run()
if err != nil {
fmt.Printf("ERROR: Failed to checkout default branch %s for repo %s: %s\n", *defaultBranch, repo.GetName(), err)
return
}

gitUpdateCmd := strings.Fields(fmt.Sprintf("git -C %s pull --rebase", repoPath))
Expand Down

0 comments on commit ae7f73f

Please sign in to comment.