提交 631bc94e 编写于 作者: J Junio C Hamano

Merge branch 'yd/use-test-config-unconfig'

Bulk-update of the test suite.

* yd/use-test-config-unconfig:
  t5520: use test_config to set/unset git config variables (leftover bits)
  t7600: use test_config to set/unset git config variables
  t7502: remove clear_config
  t7502: use test_config to set/unset git config variables
  t9500: use test_config to set/unset git config variables
  t7508: use test_config to set/unset git config variables
  t7500: use test_config to set/unset git config variables
  t5541: use test_config to set/unset git config variables
  t5520: use test_config to set/unset git config variables
  t4202: use test_config/test_unconfig to set/unset git config variables
  t4034: use test_config/test_unconfig to set/unset git config variables
  t4304: use test_config to set/unset git config variables
  t3400: use test_config to set/unset git config variables
......@@ -138,8 +138,7 @@ test_expect_success 'rebase a single mode change' '
'
test_expect_success 'rebase is not broken by diff.renames' '
git config diff.renames copies &&
test_when_finished "git config --unset diff.renames" &&
test_config diff.renames copies &&
git checkout filemove &&
GIT_TRACE=1 git rebase force-3way
'
......
......@@ -937,8 +937,7 @@ test_expect_success 'rebase --edit-todo can be used to modify todo' '
test_expect_success 'rebase -i respects core.commentchar' '
git reset --hard &&
git checkout E^0 &&
git config core.commentchar "\\" &&
test_when_finished "git config --unset core.commentchar" &&
test_config core.commentchar "\\" &&
write_script remove-all-but-first.sh <<-\EOF &&
sed -e "2,\$s/^/\\\\/" "$1" >"$1.tmp" &&
mv "$1.tmp" "$1"
......
......@@ -230,7 +230,7 @@ test_expect_success '.gitattributes override config' '
'
test_expect_success 'setup: remove diff driver regex' '
test_might_fail git config --unset diff.testdriver.wordRegex
test_unconfig diff.testdriver.wordRegex
'
test_expect_success 'use configured regex' '
......@@ -335,8 +335,7 @@ test_expect_success 'word-diff with diff.sbe' '
c
EOF
test_when_finished "git config --unset diff.suppress-blank-empty" &&
git config diff.suppress-blank-empty true &&
test_config diff.suppress-blank-empty true &&
word_diff --word-diff=plain
'
......@@ -368,7 +367,7 @@ test_expect_success 'setup history with two files' '
test_expect_success 'wordRegex for the first file does not apply to the second' '
echo "*.tex diff=tex" >.gitattributes &&
git config diff.tex.wordRegex "[a-z]+|." &&
test_config diff.tex.wordRegex "[a-z]+|." &&
cat >expect <<-\EOF &&
diff --git a/a.tex b/a.tex
--- a/a.tex
......
......@@ -419,8 +419,6 @@ test_expect_success 'log --graph with merge' '
'
test_expect_success 'log.decorate configuration' '
test_might_fail git config --unset-all log.decorate &&
git log --oneline >expect.none &&
git log --oneline --decorate >expect.short &&
git log --oneline --decorate=full >expect.full &&
......@@ -429,8 +427,7 @@ test_expect_success 'log.decorate configuration' '
git log --oneline >actual &&
test_cmp expect.short actual &&
git config --unset-all log.decorate &&
git config log.decorate true &&
test_config log.decorate true &&
git log --oneline >actual &&
test_cmp expect.short actual &&
git log --oneline --decorate=full >actual &&
......@@ -438,8 +435,7 @@ test_expect_success 'log.decorate configuration' '
git log --oneline --decorate=no >actual &&
test_cmp expect.none actual &&
git config --unset-all log.decorate &&
git config log.decorate no &&
test_config log.decorate no &&
git log --oneline >actual &&
test_cmp expect.none actual &&
git log --oneline --decorate >actual &&
......@@ -447,8 +443,7 @@ test_expect_success 'log.decorate configuration' '
git log --oneline --decorate=full >actual &&
test_cmp expect.full actual &&
git config --unset-all log.decorate &&
git config log.decorate 1 &&
test_config log.decorate 1 &&
git log --oneline >actual &&
test_cmp expect.short actual &&
git log --oneline --decorate=full >actual &&
......@@ -456,8 +451,7 @@ test_expect_success 'log.decorate configuration' '
git log --oneline --decorate=no >actual &&
test_cmp expect.none actual &&
git config --unset-all log.decorate &&
git config log.decorate short &&
test_config log.decorate short &&
git log --oneline >actual &&
test_cmp expect.short actual &&
git log --oneline --no-decorate >actual &&
......@@ -465,8 +459,7 @@ test_expect_success 'log.decorate configuration' '
git log --oneline --decorate=full >actual &&
test_cmp expect.full actual &&
git config --unset-all log.decorate &&
git config log.decorate full &&
test_config log.decorate full &&
git log --oneline >actual &&
test_cmp expect.full actual &&
git log --oneline --no-decorate >actual &&
......@@ -474,16 +467,15 @@ test_expect_success 'log.decorate configuration' '
git log --oneline --decorate >actual &&
test_cmp expect.short actual
git config --unset-all log.decorate &&
test_unconfig log.decorate &&
git log --pretty=raw >expect.raw &&
git config log.decorate full &&
test_config log.decorate full &&
git log --pretty=raw >actual &&
test_cmp expect.raw actual
'
test_expect_success 'reflog is expected format' '
test_might_fail git config --remove-section log &&
git log -g --abbrev-commit --pretty=oneline >expect &&
git reflog >actual &&
test_cmp expect actual
......@@ -496,10 +488,6 @@ test_expect_success 'whatchanged is expected format' '
'
test_expect_success 'log.abbrevCommit configuration' '
test_when_finished "git config --unset log.abbrevCommit" &&
test_might_fail git config --unset log.abbrevCommit &&
git log --abbrev-commit >expect.log.abbrev &&
git log --no-abbrev-commit >expect.log.full &&
git log --pretty=raw >expect.log.raw &&
......@@ -508,7 +496,7 @@ test_expect_success 'log.abbrevCommit configuration' '
git whatchanged --abbrev-commit >expect.whatchanged.abbrev &&
git whatchanged --no-abbrev-commit >expect.whatchanged.full &&
git config log.abbrevCommit true &&
test_config log.abbrevCommit true &&
git log >actual &&
test_cmp expect.log.abbrev actual &&
......
......@@ -96,8 +96,7 @@ test_expect_success '--rebase' '
'
test_expect_success 'pull.rebase' '
git reset --hard before-rebase &&
git config --bool pull.rebase true &&
test_when_finished "git config --unset pull.rebase" &&
test_config pull.rebase true &&
git pull . copy &&
test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
test new = $(git show HEAD:file2)
......@@ -105,8 +104,7 @@ test_expect_success 'pull.rebase' '
test_expect_success 'branch.to-rebase.rebase' '
git reset --hard before-rebase &&
git config --bool branch.to-rebase.rebase true &&
test_when_finished "git config --unset branch.to-rebase.rebase" &&
test_config branch.to-rebase.rebase true &&
git pull . copy &&
test $(git rev-parse HEAD^) = $(git rev-parse copy) &&
test new = $(git show HEAD:file2)
......@@ -114,10 +112,8 @@ test_expect_success 'branch.to-rebase.rebase' '
test_expect_success 'branch.to-rebase.rebase should override pull.rebase' '
git reset --hard before-rebase &&
git config --bool pull.rebase true &&
test_when_finished "git config --unset pull.rebase" &&
git config --bool branch.to-rebase.rebase false &&
test_when_finished "git config --unset branch.to-rebase.rebase" &&
test_config pull.rebase true &&
test_config branch.to-rebase.rebase false &&
git pull . copy &&
test $(git rev-parse HEAD^) != $(git rev-parse copy) &&
test new = $(git show HEAD:file2)
......@@ -171,9 +167,9 @@ test_expect_success 'pull --rebase dies early with dirty working directory' '
git update-ref refs/remotes/me/copy copy^ &&
COPY=$(git rev-parse --verify me/copy) &&
git rebase --onto $COPY copy &&
git config branch.to-rebase.remote me &&
git config branch.to-rebase.merge refs/heads/copy &&
git config branch.to-rebase.rebase true &&
test_config branch.to-rebase.remote me &&
test_config branch.to-rebase.merge refs/heads/copy &&
test_config branch.to-rebase.rebase true &&
echo dirty >> file &&
git add file &&
test_must_fail git pull &&
......
......@@ -181,8 +181,7 @@ test_expect_success 'push (chunked)' '
git checkout master &&
test_commit commit path3 &&
HEAD=$(git rev-parse --verify HEAD) &&
git config http.postbuffer 4 &&
test_when_finished "git config --unset http.postbuffer" &&
test_config http.postbuffer 4 &&
git push -v -v origin $BRANCH 2>err &&
grep "POST git-receive-pack (chunked)" err &&
(cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
......
......@@ -36,8 +36,7 @@ test_expect_success 'nonexistent template file should return error' '
'
test_expect_success 'nonexistent template file in config should return error' '
git config commit.template "$PWD"/notexist &&
test_when_finished "git config --unset commit.template" &&
test_config commit.template "$PWD"/notexist &&
(
GIT_EDITOR="echo hello >\"\$1\"" &&
export GIT_EDITOR &&
......@@ -93,14 +92,13 @@ test_expect_success '-t option should be short for --template' '
test_expect_success 'config-specified template should commit' '
echo "new template" > "$TEMPLATE" &&
git config commit.template "$TEMPLATE" &&
test_config commit.template "$TEMPLATE" &&
echo "more content" >> foo &&
git add foo &&
(
test_set_editor "$TEST_DIRECTORY"/t7500/add-content &&
git commit
) &&
git config --unset commit.template &&
commit_msg_is "new templatecommit message"
'
......
......@@ -171,10 +171,9 @@ test_expect_success 'verbose' '
test_expect_success 'verbose respects diff config' '
git config color.diff always &&
test_config color.diff always &&
git status -v >actual &&
grep "\[1mdiff --git" actual &&
git config --unset color.diff
grep "\[1mdiff --git" actual
'
mesg_with_comment_and_newlines='
......@@ -435,16 +434,6 @@ EOF
echo '## Custom template' >template
clear_config () {
(
git config --unset-all "$1"
case $? in
0|5) exit 0 ;;
*) exit 1 ;;
esac
)
}
try_commit () {
git reset --hard &&
echo >>negative &&
......@@ -460,67 +449,57 @@ try_commit () {
try_commit_status_combo () {
test_expect_success 'commit' '
clear_config commit.status &&
try_commit "" &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit' '
clear_config commit.status &&
try_commit "" &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status' '
clear_config commit.status &&
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status' '
clear_config commit.status &&
try_commit --no-status &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit with commit.status = yes' '
clear_config commit.status &&
git config commit.status yes &&
test_config commit.status yes &&
try_commit "" &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit with commit.status = no' '
clear_config commit.status &&
git config commit.status no &&
test_config commit.status no &&
try_commit "" &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status with commit.status = yes' '
clear_config commit.status &&
git config commit.status yes &&
test_config commit.status yes &&
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status with commit.status = yes' '
clear_config commit.status &&
git config commit.status yes &&
test_config commit.status yes &&
try_commit --no-status &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --status with commit.status = no' '
clear_config commit.status &&
git config commit.status no &&
test_config commit.status no &&
try_commit --status &&
test_i18ngrep "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
test_expect_success 'commit --no-status with commit.status = no' '
clear_config commit.status &&
git config commit.status no &&
test_config commit.status no &&
try_commit --no-status &&
test_i18ngrep ! "^# Changes to be committed:" .git/COMMIT_EDITMSG
'
......@@ -534,8 +513,7 @@ use_template="-t template"
try_commit_status_combo
test_expect_success 'commit --status with custom comment character' '
test_when_finished "git config --unset core.commentchar" &&
git config core.commentchar ";" &&
test_config core.commentchar ";" &&
try_commit --status &&
test_i18ngrep "^; Changes to be committed:" .git/COMMIT_EDITMSG
'
......
......@@ -131,8 +131,7 @@ cat >expect <<\EOF
EOF
test_expect_success 'status (advice.statusHints false)' '
test_when_finished "git config --unset advice.statusHints" &&
git config advice.statusHints false &&
test_config advice.statusHints false &&
git status >output &&
test_i18ncmp expect output
......@@ -332,8 +331,7 @@ test_expect_success 'status -uno' '
'
test_expect_success 'status (status.showUntrackedFiles no)' '
git config status.showuntrackedfiles no
test_when_finished "git config --unset status.showuntrackedfiles" &&
test_config status.showuntrackedfiles no &&
git status >output &&
test_i18ncmp expect output
'
......@@ -348,12 +346,11 @@ cat >expect <<EOF
#
# Untracked files not listed
EOF
git config advice.statusHints false
test_expect_success 'status -uno (advice.statusHints false)' '
test_config advice.statusHints false &&
git status -uno >output &&
test_i18ncmp expect output
'
git config --unset advice.statusHints
cat >expect << EOF
M dir1/modified
......@@ -400,8 +397,7 @@ test_expect_success 'status -unormal' '
'
test_expect_success 'status (status.showUntrackedFiles normal)' '
git config status.showuntrackedfiles normal
test_when_finished "git config --unset status.showuntrackedfiles" &&
test_config status.showuntrackedfiles normal
git status >output &&
test_i18ncmp expect output
'
......@@ -459,8 +455,7 @@ test_expect_success 'status -uall' '
'
test_expect_success 'status (status.showUntrackedFiles all)' '
git config status.showuntrackedfiles all
test_when_finished "git config --unset status.showuntrackedfiles" &&
test_config status.showuntrackedfiles all
git status >output &&
test_i18ncmp expect output
'
......@@ -485,10 +480,9 @@ test_expect_success 'status -s -uall' '
test_cmp expect output
'
test_expect_success 'status -s (status.showUntrackedFiles all)' '
git config status.showuntrackedfiles all
test_config status.showuntrackedfiles all &&
git status -s >output &&
rm -rf dir3 &&
git config --unset status.showuntrackedfiles &&
test_cmp expect output
'
......@@ -588,15 +582,13 @@ cat >expect <<\EOF
EOF
test_expect_success 'status with color.ui' '
git config color.ui always &&
test_when_finished "git config --unset color.ui" &&
test_config color.ui always &&
git status | test_decode_color >output &&
test_i18ncmp expect output
'
test_expect_success 'status with color.status' '
git config color.status always &&
test_when_finished "git config --unset color.status" &&
test_config color.status always &&
git status | test_decode_color >output &&
test_i18ncmp expect output
'
......@@ -720,8 +712,7 @@ EOF
test_expect_success 'status without relative paths' '
git config status.relativePaths false &&
test_when_finished "git config --unset status.relativePaths" &&
test_config status.relativePaths false &&
(cd dir1 && git status) >output &&
test_i18ncmp expect output
......@@ -740,8 +731,7 @@ EOF
test_expect_success 'status -s without relative paths' '
git config status.relativePaths false &&
test_when_finished "git config --unset status.relativePaths" &&
test_config status.relativePaths false &&
(cd dir1 && git status -s) >output &&
test_cmp expect output
......@@ -1038,15 +1028,14 @@ test_expect_success '--ignore-submodules=untracked suppresses submodules with un
'
test_expect_success '.gitmodules ignore=untracked suppresses submodules with untracked content' '
git config diff.ignoreSubmodules dirty &&
test_config diff.ignoreSubmodules dirty &&
git status >output &&
test_i18ncmp expect output &&
git config --add -f .gitmodules submodule.subname.ignore untracked &&
git config --add -f .gitmodules submodule.subname.path sm &&
git status >output &&
test_i18ncmp expect output &&
git config -f .gitmodules --remove-section submodule.subname &&
git config --unset diff.ignoreSubmodules
git config -f .gitmodules --remove-section submodule.subname
'
test_expect_success '.git/config ignore=untracked suppresses submodules with untracked content' '
......@@ -1066,15 +1055,14 @@ test_expect_success '--ignore-submodules=dirty suppresses submodules with untrac
'
test_expect_success '.gitmodules ignore=dirty suppresses submodules with untracked content' '
git config diff.ignoreSubmodules dirty &&
test_config diff.ignoreSubmodules dirty &&
git status >output &&
! test -s actual &&
git config --add -f .gitmodules submodule.subname.ignore dirty &&
git config --add -f .gitmodules submodule.subname.path sm &&
git status >output &&
test_i18ncmp expect output &&
git config -f .gitmodules --remove-section submodule.subname &&
git config --unset diff.ignoreSubmodules
git config -f .gitmodules --remove-section submodule.subname
'
test_expect_success '.git/config ignore=dirty suppresses submodules with untracked content' '
......@@ -1291,15 +1279,13 @@ cat > expect << EOF
EOF
test_expect_success "status (core.commentchar with submodule summary)" '
test_when_finished "git config --unset core.commentchar" &&
git config core.commentchar ";" &&
test_config core.commentchar ";" &&
git status >output &&
test_i18ncmp expect output
'
test_expect_success "status (core.commentchar with two chars with submodule summary)" '
test_when_finished "git config --unset core.commentchar" &&
git config core.commentchar ";;" &&
test_config core.commentchar ";;" &&
git status >output &&
test_i18ncmp expect output
'
......
......@@ -56,7 +56,8 @@ create_merge_msgs () {
echo &&
git log --no-merges ^HEAD c2 c3
} >squash.1-5-9 &&
echo >msg.nolog &&
: >msg.nologff &&
echo >msg.nolognoff &&
{
echo "* tag 'c3':" &&
echo " commit 3" &&
......@@ -244,8 +245,7 @@ test_expect_success 'merges with --ff-only' '
test_expect_success 'merges with merge.ff=only' '
git reset --hard c1 &&
test_tick &&
test_when_finished "git config --unset merge.ff" &&
git config merge.ff only &&
test_config merge.ff "only" &&
test_must_fail git merge c2 &&
test_must_fail git merge c3 &&
test_must_fail git merge c2 c3 &&
......@@ -336,7 +336,7 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c2 (no-commit in config)' '
git reset --hard c1 &&
git config branch.master.mergeoptions "--no-commit" &&
test_config branch.master.mergeoptions "--no-commit" &&
git merge c2 &&
verify_merge file result.1-5 &&
verify_head $c1 &&
......@@ -346,12 +346,11 @@ test_expect_success 'merge c1 with c2 (no-commit in config)' '
test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c2 (log in config)' '
git config branch.master.mergeoptions "" &&
git reset --hard c1 &&
git merge --log c2 &&
git show -s --pretty=tformat:%s%n%b >expect &&
git config branch.master.mergeoptions --log &&
test_config branch.master.mergeoptions "--log" &&
git reset --hard c1 &&
git merge c2 &&
git show -s --pretty=tformat:%s%n%b >actual &&
......@@ -360,17 +359,12 @@ test_expect_success 'merge c1 with c2 (log in config)' '
'
test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
test_when_finished "git config --remove-section branch.master" &&
test_when_finished "git config --remove-section merge" &&
test_might_fail git config --remove-section branch.master &&
test_might_fail git config --remove-section merge &&
git reset --hard c1 &&
git merge c2 &&
git show -s --pretty=tformat:%s%n%b >expect &&
git config branch.master.mergeoptions "--no-log" &&
git config merge.log true &&
test_config branch.master.mergeoptions "--no-log" &&
test_config merge.log "true" &&
git reset --hard c1 &&
git merge c2 &&
git show -s --pretty=tformat:%s%n%b >actual &&
......@@ -380,7 +374,7 @@ test_expect_success 'merge c1 with c2 (log in config gets overridden)' '
test_expect_success 'merge c1 with c2 (squash in config)' '
git reset --hard c1 &&
git config branch.master.mergeoptions "--squash" &&
test_config branch.master.mergeoptions "--squash" &&
git merge c2 &&
verify_merge file result.1-5 &&
verify_head $c1 &&
......@@ -392,7 +386,7 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'override config option -n with --summary' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_config branch.master.mergeoptions "-n" &&
test_tick &&
git merge --summary c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
......@@ -406,7 +400,7 @@ test_expect_success 'override config option -n with --summary' '
test_expect_success 'override config option -n with --stat' '
git reset --hard c1 &&
git config branch.master.mergeoptions "-n" &&
test_config branch.master.mergeoptions "-n" &&
test_tick &&
git merge --stat c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
......@@ -422,7 +416,7 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'override config option --stat' '
git reset --hard c1 &&
git config branch.master.mergeoptions "--stat" &&
test_config branch.master.mergeoptions "--stat" &&
test_tick &&
git merge -n c2 >diffstat.txt &&
verify_merge file result.1-5 msg.1-5 &&
......@@ -438,7 +432,7 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c2 (override --no-commit)' '
git reset --hard c1 &&
git config branch.master.mergeoptions "--no-commit" &&
test_config branch.master.mergeoptions "--no-commit" &&
test_tick &&
git merge --commit c2 &&
verify_merge file result.1-5 msg.1-5 &&
......@@ -449,7 +443,7 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c2 (override --squash)' '
git reset --hard c1 &&
git config branch.master.mergeoptions "--squash" &&
test_config branch.master.mergeoptions "--squash" &&
test_tick &&
git merge --no-squash c2 &&
verify_merge file result.1-5 msg.1-5 &&
......@@ -460,7 +454,6 @@ test_debug 'git log --graph --decorate --oneline --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 &&
......@@ -471,10 +464,9 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c0 with c1 (merge.ff=false)' '
git reset --hard c0 &&
git config merge.ff false &&
test_config merge.ff "false" &&
test_tick &&
git merge c1 &&
git config --remove-section merge &&
verify_merge file result.1 &&
verify_parents $c0 $c1
'
......@@ -482,22 +474,19 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'combine branch.master.mergeoptions with merge.ff' '
git reset --hard c0 &&
git config branch.master.mergeoptions --ff &&
git config merge.ff false &&
test_config branch.master.mergeoptions "--ff" &&
test_config merge.ff "false" &&
test_tick &&
git merge c1 &&
git config --remove-section "branch.master" &&
git config --remove-section "merge" &&
verify_merge file result.1 &&
verify_parents "$c0"
'
test_expect_success 'tolerate unknown values for merge.ff' '
git reset --hard c0 &&
git config merge.ff something-new &&
test_config merge.ff "something-new" &&
test_tick &&
git merge c1 2>message &&
git config --remove-section "merge" &&
verify_head "$c1" &&
test_cmp empty message
'
......@@ -515,7 +504,7 @@ test_expect_success 'combining --ff-only and --no-ff is refused' '
test_expect_success 'merge c0 with c1 (ff overrides no-ff)' '
git reset --hard c0 &&
git config branch.master.mergeoptions "--no-ff" &&
test_config branch.master.mergeoptions "--no-ff" &&
git merge --ff c1 &&
verify_merge file result.1 &&
verify_head $c1
......@@ -525,14 +514,20 @@ test_expect_success 'merge log message' '
git reset --hard c0 &&
git merge --no-log c2 &&
git show -s --pretty=format:%b HEAD >msg.act &&
test_cmp msg.nolog msg.act &&
test_cmp msg.nologff msg.act &&
git reset --hard c0 &&
test_config branch.master.mergeoptions "--no-ff" &&
git merge --no-log c2 &&
git show -s --pretty=format:%b HEAD >msg.act &&
test_cmp msg.nolognoff msg.act &&
git merge --log c3 &&
git show -s --pretty=format:%b HEAD >msg.act &&
test_cmp msg.log msg.act &&
git reset --hard HEAD^ &&
git config merge.log yes &&
test_config merge.log "yes" &&
git merge c3 &&
git show -s --pretty=format:%b HEAD >msg.act &&
test_cmp msg.log msg.act
......@@ -542,7 +537,6 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c0, c2, c0, and c1' '
git reset --hard c1 &&
git config branch.master.mergeoptions "" &&
test_tick &&
git merge c0 c2 c0 c1 &&
verify_merge file result.1-5 &&
......@@ -553,7 +547,6 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c0, c2, c0, and c1' '
git reset --hard c1 &&
git config branch.master.mergeoptions "" &&
test_tick &&
git merge c0 c2 c0 c1 &&
verify_merge file result.1-5 &&
......@@ -564,7 +557,6 @@ test_debug 'git log --graph --decorate --oneline --all'
test_expect_success 'merge c1 with c1 and c2' '
git reset --hard c1 &&
git config branch.master.mergeoptions "" &&
test_tick &&
git merge c1 c2 &&
verify_merge file result.1-5 &&
......
......@@ -539,8 +539,7 @@ test_expect_success \
test_when_finished "GIT_COMMITTER_NAME=\"C O Mitter\"" &&
echo "ISO-8859-1" >> file &&
git add file &&
git config i18n.commitencoding ISO-8859-1 &&
test_when_finished "git config --unset i18n.commitencoding" &&
test_config i18n.commitencoding ISO-8859-1 &&
git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
gitweb_run "p=.git;a=commit"'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册