summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-05-02 15:58:27 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-02 15:58:27 -0700
commit2db8926236406a4e4cb17d1b9c4b791706fb0512 (patch)
tree2156bd237ac11f679bbc3bb9e085cae81d12e441 /t
parentUpdate draft release notes to 1.7.6 (diff)
parentdiffcore-rename: don't consider unmerged path as source (diff)
downloadtgif-2db8926236406a4e4cb17d1b9c4b791706fb0512.tar.xz
Merge branch 'mz/maint-rename-unmerged'
* mz/maint-rename-unmerged: diffcore-rename: don't consider unmerged path as source
Diffstat (limited to 't')
-rwxr-xr-xt/t7060-wtstatus.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/t/t7060-wtstatus.sh b/t/t7060-wtstatus.sh
index b4fcc86a10..3a5d927f83 100755
--- a/t/t7060-wtstatus.sh
+++ b/t/t7060-wtstatus.sh
@@ -56,4 +56,66 @@ test_expect_success C_LOCALE_OUTPUT 'M/D conflict does not segfault' '
)
'
+test_expect_success 'rename & unmerged setup' '
+ git rm -f -r . &&
+ cat "$TEST_DIRECTORY/README" >ONE &&
+ git add ONE &&
+ test_tick &&
+ git commit -m "One commit with ONE" &&
+
+ echo Modified >TWO &&
+ cat ONE >>TWO &&
+ cat ONE >>THREE &&
+ git add TWO THREE &&
+ sha1=$(git rev-parse :ONE) &&
+ git rm --cached ONE &&
+ (
+ echo "100644 $sha1 1 ONE" &&
+ echo "100644 $sha1 2 ONE" &&
+ echo "100644 $sha1 3 ONE"
+ ) | git update-index --index-info &&
+ echo Further >>THREE
+'
+
+test_expect_success 'rename & unmerged status' '
+ git status -suno >actual &&
+ cat >expect <<-EOF &&
+ UU ONE
+ AM THREE
+ A TWO
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'git diff-index --cached shows 2 added + 1 unmerged' '
+ cat >expected <<-EOF &&
+ U ONE
+ A THREE
+ A TWO
+ EOF
+ git diff-index --cached --name-status HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'git diff-index --cached -M shows 2 added + 1 unmerged' '
+ cat >expected <<-EOF &&
+ U ONE
+ A THREE
+ A TWO
+ EOF
+ git diff-index --cached --name-status HEAD >actual &&
+ test_cmp expected actual
+'
+
+test_expect_success 'git diff-index --cached -C shows 2 copies + 1 unmerged' '
+ cat >expected <<-EOF &&
+ U ONE
+ C ONE THREE
+ C ONE TWO
+ EOF
+ git diff-index --cached -C --name-status HEAD |
+ sed "s/^C[0-9]*/C/g" >actual &&
+ test_cmp expected actual
+'
+
test_done