From: Junio C Hamano Date: Mon, 30 Sep 2019 04:19:23 +0000 (+0900) Subject: Merge branch 'bc/hash-independent-tests-part-5' X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/0281733483c19e5bcd58b0e148707b9fb7f8c20a?hp=-c Merge branch 'bc/hash-independent-tests-part-5' Preparation for SHA-256 upgrade continues in the test department. * bc/hash-independent-tests-part-5: t4009: make hash size independent t4002: make hash independent t4000: make hash size independent t3903: abstract away SHA-1-specific constants t3800: make hash-size independent t3600: make hash size independent t3506: make hash independent t3430: avoid hard-coded object IDs t3404: abstract away SHA-1-specific constants t3306: abstract away SHA-1-specific constants t3305: make hash size independent t3301: abstract away SHA-1-specific constants t3206: abstract away hash size constants t3201: abstract away SHA-1-specific constants --- 0281733483c19e5bcd58b0e148707b9fb7f8c20a diff --combined t/t3404-rebase-interactive.sh index 31114d0bbb,87ee69f78e..3ea67d75b5 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@@ -29,9 -29,6 +29,6 @@@ Initial setup . "$TEST_DIRECTORY"/lib-rebase.sh - # WARNING: Modifications to the initial repository can change the SHA ID used - # in the expect2 file for the 'stop on conflicting pick' test. - test_expect_success 'setup' ' test_commit A file1 && test_commit B file1 && @@@ -155,6 -152,8 +152,6 @@@ test_expect_success 'rebase -x with emp test_i18ncmp expected actual ' -LF=' -' test_expect_success 'rebase -x with newline in command fails' ' test_when_finished "git rebase --abort ||:" && test_must_fail env git rebase -x "a${LF}b" @ 2>actual && @@@ -231,25 -230,28 +228,28 @@@ test_expect_success 'exchange two commi set_fake_editor && FAKE_LINES="2 1" git rebase -i HEAD~2 && test H = $(git cat-file commit HEAD^ | sed -ne \$p) && - test G = $(git cat-file commit HEAD | sed -ne \$p) + test G = $(git cat-file commit HEAD | sed -ne \$p) && + blob1=$(git rev-parse --short HEAD^:file1) && + blob2=$(git rev-parse --short HEAD:file1) && + commit=$(git rev-parse --short HEAD) ' test_expect_success 'stop on conflicting pick' ' - cat >expect <<-\EOF && + cat >expect <<-EOF && diff --git a/file1 b/file1 - index f70f10e..fd79235 100644 + index $blob1..$blob2 100644 --- a/file1 +++ b/file1 @@ -1 +1 @@ -A +G EOF - cat >expect2 <<-\EOF && + cat >expect2 <<-EOF && <<<<<<< HEAD D ======= G - >>>>>>> 5d18e54... G + >>>>>>> $commit... G EOF git tag new-branch1 && set_fake_editor && @@@ -1001,7 -1003,7 +1001,7 @@@ test_expect_success 'rebase -i --root t git checkout B && set_fake_editor && test_must_fail env FAKE_LINES="2" git rebase -i --root && - git cat-file commit HEAD | grep "^tree 4b825dc642cb" && + git cat-file commit HEAD | grep "^tree $EMPTY_TREE" && git rebase --abort ' @@@ -1159,7 -1161,7 +1159,7 @@@ test_expect_success 'rebase -i error o test_expect_code 1 grep " emp" error ' - test_expect_success 'short SHA-1 setup' ' + test_expect_success SHA1 'short SHA-1 setup' ' test_when_finished "git checkout master" && git checkout --orphan collide && git rm -rf . && @@@ -1171,7 -1173,7 +1171,7 @@@ ) ' - test_expect_success 'short SHA-1 collide' ' + test_expect_success SHA1 'short SHA-1 collide' ' test_when_finished "reset_rebase && git checkout master" && git checkout collide && ( diff --combined t/t3430-rebase-merges.sh index fe6489fed6,c1ea2ee297..cefed4e617 --- a/t/t3430-rebase-merges.sh +++ b/t/t3430-rebase-merges.sh @@@ -37,20 -37,27 +37,27 @@@ test_expect_success 'setup' test_commit A && git checkout -b first && test_commit B && + b=$(git rev-parse --short HEAD) && git checkout master && test_commit C && + c=$(git rev-parse --short HEAD) && test_commit D && + d=$(git rev-parse --short HEAD) && git merge --no-commit B && test_tick && git commit -m E && git tag -m E E && + e=$(git rev-parse --short HEAD) && git checkout -b second C && test_commit F && + f=$(git rev-parse --short HEAD) && test_commit G && + g=$(git rev-parse --short HEAD) && git checkout master && git merge --no-commit G && test_tick && git commit -m H && + h=$(git rev-parse --short HEAD) && git tag -m H H && git checkout A && test_commit conflicting-G G.t @@@ -93,24 -100,24 +100,24 @@@ test_expect_success 'create completely ' test_expect_success 'generate correct todo list' ' - cat >expect <<-\EOF && + cat >expect <<-EOF && label onto reset onto - pick d9df450 B + pick $b B label E reset onto - pick 5dee784 C + pick $c C label branch-point - pick ca2c861 F - pick 088b00a G + pick $f F + pick $g G label H reset branch-point # C - pick 12bd07b D - merge -C 2051b56 E # E - merge -C 233d48a H # H + pick $d D + merge -C $e E # E + merge -C $h H # H EOF @@@ -441,25 -448,4 +448,25 @@@ test_expect_success '--continue after r test_path_is_missing .git/MERGE_HEAD ' +test_expect_success '--rebase-merges with strategies' ' + git checkout -b with-a-strategy F && + test_tick && + git merge -m "Merge conflicting-G" conflicting-G && + + : first, test with a merge strategy option && + git rebase -ir -Xtheirs G && + echo conflicting-G >expect && + test_cmp expect G.t && + + : now, try with a merge strategy other than recursive && + git reset --hard @{1} && + write_script git-merge-override <<-\EOF && + echo overridden$1 >>G.t + git add G.t + EOF + PATH="$PWD:$PATH" git rebase -ir -s override -Xxopt G && + test_write_lines G overridden--xopt >expect && + test_cmp expect G.t +' + test_done