From: Junio C Hamano Date: Mon, 14 Sep 2015 18:46:28 +0000 (-0700) Subject: Merge branch 'mp/t7060-diff-index-test' X-Git-Tag: v2.6.0-rc2~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/971f9ea54313d189e6a79395b5a6e335101bd85a?hp=-c Merge branch 'mp/t7060-diff-index-test' Fix an old test that was doing the same thing as another one. * mp/t7060-diff-index-test: t7060: actually test "git diff-index --cached -M" --- 971f9ea54313d189e6a79395b5a6e335101bd85a diff --combined t/t7060-wtstatus.sh index 741ec08576,a886a4436f..32d81765cb --- a/t/t7060-wtstatus.sh +++ b/t/t7060-wtstatus.sh @@@ -5,7 -5,6 +5,7 @@@ test_description='basic work tree statu . ./test-lib.sh test_expect_success setup ' + git config --global advice.statusuoption false && test_commit A && test_commit B oneside added && git checkout A^0 && @@@ -29,19 -28,17 +29,19 @@@ test_expect_success 'Report new path wi test_cmp expect actual ' -cat >expect <..." as appropriate to mark resolution) -# -# deleted by us: foo -# +test_expect_success 'M/D conflict does not segfault' ' + cat >expect <..." 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 && @@@ -53,9 -50,9 +53,9 @@@ git commit -m delete && test_must_fail git merge master && test_must_fail git commit --dry-run >../actual && - test_cmp ../expect ../actual && + test_i18ncmp ../expect ../actual && git status >../actual && - test_cmp ../expect ../actual + test_i18ncmp ../expect ../actual ) ' @@@ -106,7 -103,7 +106,7 @@@ test_expect_success 'git diff-index --c A THREE A TWO EOF - git diff-index --cached --name-status HEAD >actual && + git diff-index --cached -M --name-status HEAD >actual && test_cmp expected actual ' @@@ -121,97 -118,4 +121,97 @@@ test_expect_success 'git diff-index --c test_cmp expected actual ' + +test_expect_success 'status when conflicts with add and rm advice (deleted by them)' ' + git reset --hard && + git checkout master && + test_commit init main.txt init && + git checkout -b second_branch && + git rm main.txt && + git commit -m "main.txt deleted on second_branch" && + test_commit second conflict.txt second && + git checkout master && + 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 ..." 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 +' + + +test_expect_success 'prepare for conflicts' ' + git reset --hard && + git checkout -b conflict && + test_commit one main.txt one && + git branch conflict_second && + git mv main.txt sub_master.txt && + git commit -m "main.txt renamed in sub_master.txt" && + git checkout conflict_second && + git mv main.txt sub_second.txt && + git commit -m "main.txt renamed in sub_second.txt" +' + + +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 ..." 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 +' + + +test_expect_success 'status when conflicts with only rm advice (both deleted)' ' + git reset --hard conflict_second && + 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 ..." 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 && + git checkout master +' + + test_done