@matheusbsbs / matheus-bagliano / commits / f64d7fd267
Fork 0

git-fetch: exit with non-zero status when fast-forward check fails

When update_local_ref() refuses to update a branch head due to fast-forward check, it was not propagated properly in the call chain and the command did not exit with non-zero status as a result. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 25, 2006 at 01:04 UTC f64d7fd267c501f501e18a888e3e1e0c5b56458f
1 file changed +6 -5
git-fetch.sh
+6 -5
@@ -359,7 +359,7 @@ fetch_main () {
359 esac
360
361 append_fetch_head "$head" "$remote" \
362 - "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
362 + "$remote_name" "$remote_nick" "$local_name" "$not_for_merge" || exit
363
364 done
365
@@ -413,15 +413,16 @@ fetch_main () {
413 done
414 local_name=$(expr "z$found" : 'z[^:]*:\(.*\)')
415 append_fetch_head "$sha1" "$remote" \
416 - "$remote_name" "$remote_nick" "$local_name" "$not_for_merge"
417 - done
416 + "$remote_name" "$remote_nick" "$local_name" \
417 + "$not_for_merge" || exit
418 + done &&
419 if [ "$pack_lockfile" ]; then rm -f "$pack_lockfile"; fi
420 ) || exit ;;
421 esac
422
423 }
424
424 -fetch_main "$reflist"
425 +fetch_main "$reflist" || exit
426
427 # automated tag following
428 case "$no_tags$tags" in
@@ -449,7 +450,7 @@ case "$no_tags$tags" in
450 case "$taglist" in
451 '') ;;
452 ?*)
452 - fetch_main "$taglist" ;;
453 + fetch_main "$taglist" || exit ;;
454 esac
455 esac
456