@@ -243,7 +243,7 @@ cache_miss () {
243
243
}
244
244
245
245
check_parents () {
246
- missed=$( cache_miss " $1 " )
246
+ missed=$( cache_miss " $1 " ) || exit $?
247
247
local indent=$(( $2 + 1 ))
248
248
for miss in $missed
249
249
do
@@ -345,7 +345,7 @@ find_latest_squash () {
345
345
sub=
346
346
;;
347
347
esac
348
- done
348
+ done || exit $?
349
349
}
350
350
351
351
find_existing_splits () {
@@ -394,7 +394,7 @@ find_existing_splits () {
394
394
sub=
395
395
;;
396
396
esac
397
- done
397
+ done || exit $?
398
398
}
399
399
400
400
copy_commit () {
@@ -508,7 +508,7 @@ subtree_for_commit () {
508
508
test " $type " = " commit" && continue # ignore submodules
509
509
echo $tree
510
510
break
511
- done
511
+ done || exit $?
512
512
}
513
513
514
514
tree_changed () {
@@ -518,7 +518,7 @@ tree_changed () {
518
518
then
519
519
return 0 # weird parents, consider it changed
520
520
else
521
- ptree=$( toptree_for_commit $1 )
521
+ ptree=$( toptree_for_commit $1 ) || exit $?
522
522
if test " $ptree " ! = " $tree "
523
523
then
524
524
return 0 # changed
@@ -652,7 +652,7 @@ process_split_commit () {
652
652
progress " $revcount /$revmax ($createcount ) [$extracount ]"
653
653
654
654
debug " Processing commit: $rev "
655
- exists=$( cache_get " $rev " )
655
+ exists=$( cache_get " $rev " ) || exit $?
656
656
if test -n " $exists "
657
657
then
658
658
debug " prior: $exists "
@@ -661,10 +661,10 @@ process_split_commit () {
661
661
createcount=$(( $createcount + 1 ))
662
662
debug " parents: $parents "
663
663
check_parents " $parents " " $indent "
664
- newparents=$( cache_get $parents )
664
+ newparents=$( cache_get $parents ) || exit $?
665
665
debug " newparents: $newparents "
666
666
667
- tree=$( subtree_for_commit " $rev " " $dir " )
667
+ tree=$( subtree_for_commit " $rev " " $dir " ) || exit $?
668
668
debug " tree is: $tree "
669
669
670
670
# ugly. is there no better way to tell if this is a subtree
@@ -750,7 +750,7 @@ cmd_add_commit () {
750
750
commit=$( add_squashed_msg " $rev " " $dir " |
751
751
git commit-tree " $tree " $headp -p " $rev " ) || exit $?
752
752
else
753
- revp=$( peel_committish " $rev " ) &&
753
+ revp=$( peel_committish " $rev " ) || exit $?
754
754
commit=$( add_msg " $dir " $headrev " $rev " |
755
755
git commit-tree " $tree " $headp -p " $revp " ) || exit $?
756
756
fi
@@ -773,10 +773,10 @@ cmd_split () {
773
773
# any parent we find there can be used verbatim
774
774
debug " cache: $rev "
775
775
cache_set " $rev " " $rev "
776
- done
776
+ done || exit $?
777
777
fi
778
778
779
- unrevs=" $( find_existing_splits " $dir " " $revs " ) "
779
+ unrevs=" $( find_existing_splits " $dir " " $revs " ) " || exit $?
780
780
781
781
# We can't restrict rev-list to only $dir here, because some of our
782
782
# parents have the $dir contents the root, and those won't match.
@@ -792,7 +792,7 @@ cmd_split () {
792
792
process_split_commit " $rev " " $parents " 0
793
793
done || exit $?
794
794
795
- latest_new=$( cache_get latest_new)
795
+ latest_new=$( cache_get latest_new) || exit $?
796
796
if test -z " $latest_new "
797
797
then
798
798
die " No new revisions were found"
@@ -801,7 +801,7 @@ cmd_split () {
801
801
if test -n " $rejoin "
802
802
then
803
803
debug " Merging split branch into HEAD..."
804
- latest_old=$( cache_get latest_old)
804
+ latest_old=$( cache_get latest_old) || exit $?
805
805
git merge -s ours \
806
806
--allow-unrelated-histories \
807
807
-m " $( rejoin_msg " $dir " " $latest_old " " $latest_new " ) " \
@@ -834,7 +834,7 @@ cmd_merge () {
834
834
835
835
if test -n " $squash "
836
836
then
837
- first_split=" $( find_latest_squash " $dir " ) "
837
+ first_split=" $( find_latest_squash " $dir " ) " || exit $?
838
838
if test -z " $first_split "
839
839
then
840
840
die " Can't squash-merge: '$dir ' was never added."
0 commit comments