summaryrefslogtreecommitdiff
path: root/t/t4041-diff-submodule.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2010-03-04 21:20:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-05 06:16:33 (GMT)
commitc7e1a73641e24340bf93f6f1792220fa9154cda3 (patch)
treed414fd7b961223be35decfc3038342d63f2f4223 /t/t4041-diff-submodule.sh
parent5ce9086ddfe6931ef34fcd99778c9235e2ee1839 (diff)
downloadgit-c7e1a73641e24340bf93f6f1792220fa9154cda3.zip
git-c7e1a73641e24340bf93f6f1792220fa9154cda3.tar.gz
git-c7e1a73641e24340bf93f6f1792220fa9154cda3.tar.bz2
git diff --submodule: Show detailed dirty status of submodules
When encountering a dirty submodule while doing "git diff --submodule" print an extra line for new untracked content and another for modified but already tracked content. And if the HEAD of the submodule is equal to the ref diffed against in the superproject, drop the output which would just show the same SHA1s and no commit message headlines. To achieve that, the dirty_submodule bitfield is expanded to two bits. The output of "git status" inside the submodule is parsed to set the according bits. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4041-diff-submodule.sh')
-rwxr-xr-xt/t4041-diff-submodule.sh17
1 files changed, 11 insertions, 6 deletions
diff --git a/t/t4041-diff-submodule.sh b/t/t4041-diff-submodule.sh
index 4643054..11b1997 100755
--- a/t/t4041-diff-submodule.sh
+++ b/t/t4041-diff-submodule.sh
@@ -201,7 +201,7 @@ test_expect_success 'submodule contains untracked content' "
echo new > sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
diff actual - <<-EOF
-Submodule sm1 $head6..$head6-dirty:
+Submodule sm1 contains untracked content
EOF
"
@@ -209,7 +209,8 @@ test_expect_success 'submodule contains untracked and modifed content' "
echo new > sm1/foo6 &&
git diff-index -p --submodule=log HEAD >actual &&
diff actual - <<-EOF
-Submodule sm1 $head6..$head6-dirty:
+Submodule sm1 contains untracked content
+Submodule sm1 contains modified content
EOF
"
@@ -217,7 +218,7 @@ test_expect_success 'submodule contains modifed content' "
rm -f sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
diff actual - <<-EOF
-Submodule sm1 $head6..$head6-dirty:
+Submodule sm1 contains modified content
EOF
"
@@ -235,7 +236,8 @@ test_expect_success 'modified submodule contains untracked content' "
echo new > sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
diff actual - <<-EOF
-Submodule sm1 $head6..$head8-dirty:
+Submodule sm1 contains untracked content
+Submodule sm1 $head6..$head8:
> change
EOF
"
@@ -244,7 +246,9 @@ test_expect_success 'modified submodule contains untracked and modifed content'
echo modification >> sm1/foo6 &&
git diff-index -p --submodule=log HEAD >actual &&
diff actual - <<-EOF
-Submodule sm1 $head6..$head8-dirty:
+Submodule sm1 contains untracked content
+Submodule sm1 contains modified content
+Submodule sm1 $head6..$head8:
> change
EOF
"
@@ -253,7 +257,8 @@ test_expect_success 'modified submodule contains modifed content' "
rm -f sm1/new-file &&
git diff-index -p --submodule=log HEAD >actual &&
diff actual - <<-EOF
-Submodule sm1 $head6..$head8-dirty:
+Submodule sm1 contains modified content
+Submodule sm1 $head6..$head8:
> change
EOF
"