Skip to content

Commit

Permalink
Handle errors during git fetch origin
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLocehiliosan committed Mar 30, 2016
1 parent 301b537 commit bbec7dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion yadm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ function clone() {

#; fetch / merge (and possibly fallback to reset)
debug "Doing an initial fetch of the origin"
git fetch origin
git fetch origin || {
debug "Removing repo after failed clone"
rm -rf "$YADM_REPO"
error_out "Unable to fetch origin $1"
}
debug "Doing an initial merge of origin/master"
git merge origin/master || {
debug "Merge failed, doing a reset."
Expand Down

0 comments on commit bbec7dd

Please sign in to comment.