diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2013-09-06 19:43:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-09-06 13:33:18 -0700 |
commit | 1c7969c933c08a1a9d5b6fcd728ed95930b5b5ef (patch) | |
tree | 11e2785ae22401926dcd973c00830d31ebf49ed1 /t/t7060-wtstatus.sh | |
parent | 2556b9962e7c0353d562b7bf70eed11d8f29d0b0 (diff) | |
download | git-1c7969c933c08a1a9d5b6fcd728ed95930b5b5ef.tar.gz |
tests: don't set status.displayCommentPrefix file-wide
The previous commit set status.displayCommentPrefix file-wide in
t7060-wtstatus.sh, t7508-status.sh and t/t7512-status-help.sh to make the
patch small. However, now that status.displayCommentPrefix is not the
default, it is better to disable it in tests so that the most common
situation is also the most tested.
While we're there, move the "cat > expect << EOF" blocks inside the
tests.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7060-wtstatus.sh')
-rwxr-xr-x | t/t7060-wtstatus.sh | 113 |
1 files changed, 54 insertions, 59 deletions
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh index 5ecafac99b..7d467c034a 100755 --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@ -4,10 +4,6 @@ test_description='basic work tree status reporting' . ./test-lib.sh -test_expect_success 'use status.displayCommentPrefix by default ' ' - git config --global status.displayCommentPrefix true -' - test_expect_success setup ' git config --global advice.statusuoption false && test_commit A && @@ -33,20 +29,19 @@ test_expect_success 'Report new path with conflict' ' test_cmp expect actual ' -cat >expect <<EOF -# On branch side -# You have unmerged paths. -# (fix conflicts and run "git commit") -# -# Unmerged paths: -# (use "git add/rm <file>..." as appropriate to mark resolution) -# -# deleted by us: foo -# +test_expect_success 'M/D conflict does not segfault' ' + cat >expect <<EOF && +On branch side +You have unmerged paths. + (fix conflicts and run "git commit") + +Unmerged paths: + (use "git add/rm <file>..." as appropriate to mark resolution) + + deleted by us: foo + no changes added to commit (use "git add" and/or "git commit -a") EOF - -test_expect_success 'M/D conflict does not segfault' ' mkdir mdconflict && ( cd mdconflict && @@ -139,19 +134,19 @@ test_expect_success 'status when conflicts with add and rm advice (deleted by th test_commit on_second main.txt on_second && test_commit master conflict.txt master && test_must_fail git merge second_branch && - cat >expected <<-\EOF && - # On branch master - # You have unmerged paths. - # (fix conflicts and run "git commit") - # - # Unmerged paths: - # (use "git add/rm <file>..." as appropriate to mark resolution) - # - # both added: conflict.txt - # deleted by them: main.txt - # - no changes added to commit (use "git add" and/or "git commit -a") - EOF + cat >expected <<\EOF && +On branch master +You have unmerged paths. + (fix conflicts and run "git commit") + +Unmerged paths: + (use "git add/rm <file>..." as appropriate to mark resolution) + + both added: conflict.txt + deleted by them: main.txt + +no changes added to commit (use "git add" and/or "git commit -a") +EOF git status --untracked-files=no >actual && test_i18ncmp expected actual ' @@ -172,20 +167,20 @@ test_expect_success 'prepare for conflicts' ' test_expect_success 'status when conflicts with add and rm advice (both deleted)' ' test_must_fail git merge conflict && - cat >expected <<-\EOF && - # On branch conflict_second - # You have unmerged paths. - # (fix conflicts and run "git commit") - # - # Unmerged paths: - # (use "git add/rm <file>..." as appropriate to mark resolution) - # - # both deleted: main.txt - # added by them: sub_master.txt - # added by us: sub_second.txt - # - no changes added to commit (use "git add" and/or "git commit -a") - EOF + cat >expected <<\EOF && +On branch conflict_second +You have unmerged paths. + (fix conflicts and run "git commit") + +Unmerged paths: + (use "git add/rm <file>..." as appropriate to mark resolution) + + both deleted: main.txt + added by them: sub_master.txt + added by us: sub_second.txt + +no changes added to commit (use "git add" and/or "git commit -a") +EOF git status --untracked-files=no >actual && test_i18ncmp expected actual ' @@ -196,22 +191,22 @@ test_expect_success 'status when conflicts with only rm advice (both deleted)' ' test_must_fail git merge conflict && git add sub_master.txt && git add sub_second.txt && - cat >expected <<-\EOF && - # On branch conflict_second - # You have unmerged paths. - # (fix conflicts and run "git commit") - # - # Changes to be committed: - # - # new file: sub_master.txt - # - # Unmerged paths: - # (use "git rm <file>..." to mark resolution) - # - # both deleted: main.txt - # - # Untracked files not listed (use -u option to show untracked files) - EOF + cat >expected <<\EOF && +On branch conflict_second +You have unmerged paths. + (fix conflicts and run "git commit") + +Changes to be committed: + + new file: sub_master.txt + +Unmerged paths: + (use "git rm <file>..." to mark resolution) + + both deleted: main.txt + +Untracked files not listed (use -u option to show untracked files) +EOF git status --untracked-files=no >actual && test_i18ncmp expected actual && git reset --hard && |