X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7600-merge.sh;h=56869aceeda90281a9fed992d0b202ec03fcb9f9;hb=77ad7a49d3cc946487ca759e5361effbcfb03be5;hp=6424c6e2c0b27f6d4dd19e9088710db932d2ace9;hpb=9c51414f8efb73525a6c69917f1499dab081679d;p=git.git diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh index 6424c6e2c..56869acee 100755 --- a/t/t7600-merge.sh +++ b/t/t7600-merge.sh @@ -108,7 +108,7 @@ create_merge_msgs() { } verify_diff() { - if ! diff -u "$1" "$2" + if ! test_cmp "$1" "$2" then echo "$3" false @@ -165,7 +165,7 @@ verify_mergeheads() { fi && while test $# -gt 0 do - head=$(head -n $i .git/MERGE_HEAD | tail -n 1) + head=$(head -n $i .git/MERGE_HEAD | sed -ne \$p) if test "$1" != "$head" then echo "[OOPS] MERGE_HEAD $i != $1" @@ -371,7 +371,7 @@ test_expect_success 'override config option -n' ' git merge --summary c2 >diffstat.txt && verify_merge file result.1-5 msg.1-5 && verify_parents $c1 $c2 && - if ! grep -e "^ file | \+2 +-$" diffstat.txt + if ! grep "^ file | *2 +-$" diffstat.txt then echo "[OOPS] diffstat was not generated" fi @@ -386,7 +386,7 @@ test_expect_success 'override config option --summary' ' git merge -n c2 >diffstat.txt && verify_merge file result.1-5 msg.1-5 && verify_parents $c1 $c2 && - if grep -e "^ file | \+2 +-$" diffstat.txt + if grep "^ file | *2 +-$" diffstat.txt then echo "[OOPS] diffstat was generated" false @@ -419,6 +419,7 @@ test_debug 'gitk --all' test_expect_success 'merge c0 with c1 (no-ff)' ' git reset --hard c0 && + git config branch.master.mergeoptions "" && test_tick && git merge --no-ff c1 && verify_merge file result.1 && @@ -427,6 +428,11 @@ test_expect_success 'merge c0 with c1 (no-ff)' ' test_debug 'gitk --all' +test_expect_success 'combining --squash and --no-ff is refused' ' + test_must_fail git merge --squash --no-ff c1 && + test_must_fail git merge --no-ff --squash c1 +' + test_expect_success 'merge c0 with c1 (ff overrides no-ff)' ' git reset --hard c0 && git config branch.master.mergeoptions "--no-ff" &&