From: Junio C Hamano Date: Mon, 16 Jul 2018 21:54:55 +0000 (-0700) Subject: Merge branch 'jc/t3404-one-shot-export-fix' into es/test-lint-one-shot-export X-Git-Tag: v2.19.0-rc0~121^2~4 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f44a7442f6abeea0059fae46ce482b0c49c27de1?ds=sidebyside;hp=-c Merge branch 'jc/t3404-one-shot-export-fix' into es/test-lint-one-shot-export * jc/t3404-one-shot-export-fix: t3404: fix use of "VAR=VAL cmd" with a shell function --- f44a7442f6abeea0059fae46ce482b0c49c27de1 diff --combined t/t3404-rebase-interactive.sh index 352a52e59d,489b6196e0..449401e859 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@@ -225,14 -225,6 +225,14 @@@ test_expect_success 'stop on conflictin test 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo) ' +test_expect_success 'show conflicted patch' ' + GIT_TRACE=1 git rebase --show-current-patch >/dev/null 2>stderr && + grep "show.*REBASE_HEAD" stderr && + # the original stopped-sha1 is abbreviated + stopped_sha1="$(git rev-parse $(cat ".git/rebase-merge/stopped-sha"))" && + test "$(git rev-parse REBASE_HEAD)" = "$stopped_sha1" +' + test_expect_success 'abort' ' git rebase --abort && test $(git rev-parse new-branch1) = $(git rev-parse HEAD) && @@@ -264,11 -256,18 +264,18 @@@ test_expect_success 'retain authorship ' test_expect_success 'retain authorship w/ conflicts' ' + oGIT_AUTHOR_NAME=$GIT_AUTHOR_NAME && + test_when_finished "GIT_AUTHOR_NAME=\$oGIT_AUTHOR_NAME" && + git reset --hard twerp && test_commit a conflict a conflict-a && git reset --hard twerp && - GIT_AUTHOR_NAME=AttributeMe \ + + GIT_AUTHOR_NAME=AttributeMe && + export GIT_AUTHOR_NAME && test_commit b conflict b conflict-b && + GIT_AUTHOR_NAME=$oGIT_AUTHOR_NAME && + set_fake_editor && test_must_fail git rebase -i conflict-a && echo resolved >conflict && @@@ -461,10 -460,6 +468,10 @@@ test_expect_success C_LOCALE_OUTPUT 'sq git rebase -i $base && git cat-file commit HEAD | sed -e 1,/^\$/d > actual-squash-fixup && test_cmp expect-squash-fixup actual-squash-fixup && + git cat-file commit HEAD@{2} | + grep "^# This is a combination of 3 commits\." && + git cat-file commit HEAD@{3} | + grep "^# This is a combination of 2 commits\." && git checkout to-be-rebased && git branch -D squash-fixup ' @@@ -711,13 -706,13 +718,13 @@@ test_expect_success 'rebase -i continu test_expect_success 'avoid unnecessary reset' ' git checkout master && git reset --hard && - test-chmtime =123456789 file3 && + test-tool chmtime =123456789 file3 && git update-index --refresh && HEAD=$(git rev-parse HEAD) && set_fake_editor && git rebase -i HEAD~4 && test $HEAD = $(git rev-parse HEAD) && - MTIME=$(test-chmtime -v +0 file3 | sed 's/[^0-9].*$//') && + MTIME=$(test-tool chmtime --get file3) && test 123456789 = $MTIME ' @@@ -927,8 -922,10 +934,8 @@@ test_expect_success 'rebase --exec work test_expect_success 'rebase -i --exec without ' ' git reset --hard execute && set_fake_editor && - test_must_fail git rebase -i --exec 2>tmp && - sed -e "1d" tmp >actual && - test_must_fail git rebase -h >expected && - test_cmp expected actual && + test_must_fail git rebase -i --exec 2>actual && + test_i18ngrep "requires a value" actual && git checkout master ' @@@ -971,16 -968,6 +978,16 @@@ test_expect_success 'rebase -i --root f test 0 = $(git cat-file commit HEAD | grep -c ^parent\ ) ' +test_expect_success 'rebase -i --root reword root commit' ' + test_when_finished "test_might_fail git rebase --abort" && + git checkout -b reword-root-branch master && + set_fake_editor && + FAKE_LINES="reword 1 2" FAKE_COMMIT_MESSAGE="A changed" \ + git rebase -i --root && + git show HEAD^ | grep "A changed" && + test -z "$(git show -s --format=%p HEAD^)" +' + test_expect_success C_LOCALE_OUTPUT 'rebase --edit-todo does not work on non-interactive rebase' ' git reset --hard && git checkout conflict-branch && @@@ -1214,6 -1201,10 +1221,6 @@@ test_expect_success 'drop' test A = $(git cat-file commit HEAD^^ | sed -ne \$p) ' -cat >expect <actual && test D = $(git cat-file commit HEAD | sed -ne \$p) && - test_i18ncmp expect actual + test_i18ngrep \ + "Successfully rebased and updated refs/heads/missing-commit" \ + actual ' cat >expect <actual && + git rebase -i --root 2>actual.2 && + cr_to_nl actual && test_i18ncmp expect actual && test D = $(git cat-file commit HEAD | sed -ne \$p) ' @@@ -1363,16 -1343,6 +1370,16 @@@ test_expect_success 'editor saves as CR SQ="'" test_expect_success 'rebase -i --gpg-sign=' ' + test_when_finished "test_might_fail git rebase --abort" && + set_fake_editor && + FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" HEAD^ \ + >out 2>err && + test_i18ngrep "$SQ-S\"S I Gner\"$SQ" err +' + +test_expect_success 'rebase -i --gpg-sign= overrides commit.gpgSign' ' + test_when_finished "test_might_fail git rebase --abort" && + test_config commit.gpgsign true && set_fake_editor && FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" HEAD^ \ >out 2>err &&