summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-05-29 12:34:42 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-05-29 12:34:42 +0900
commita531ecf399a5d2ddb97dbd79bbcdad2dd93e7268 (patch)
treea6052ef0b98bb1c4c1a8c171e69d1d4f7507a1da /t
parentMerge branch 'bw/dir-c-stops-relying-on-the-index' (diff)
parentdiff: recurse into nested submodules for inline diff (diff)
downloadtgif-a531ecf399a5d2ddb97dbd79bbcdad2dd93e7268.tar.xz
Merge branch 'jk/diff-submodule-diff-inline'
"git diff --submodule=diff" now recurses into nested submodules. * jk/diff-submodule-diff-inline: diff: recurse into nested submodules for inline diff
Diffstat (limited to 't')
-rwxr-xr-xt/t4060-diff-submodule-option-diff-format.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/t4060-diff-submodule-option-diff-format.sh b/t/t4060-diff-submodule-option-diff-format.sh
index d4a3ffa69c..33ec26d755 100755
--- a/t/t4060-diff-submodule-option-diff-format.sh
+++ b/t/t4060-diff-submodule-option-diff-format.sh
@@ -775,4 +775,45 @@ test_expect_success 'diff --submodule=diff with moved nested submodule HEAD' '
test_cmp expected actual
'
+test_expect_success 'diff --submodule=diff recurses into nested submodules' '
+ cat >expected <<-EOF &&
+ Submodule sm2 contains modified content
+ Submodule sm2 a5a65c9..280969a:
+ diff --git a/sm2/.gitmodules b/sm2/.gitmodules
+ new file mode 100644
+ index 0000000..3a816b8
+ --- /dev/null
+ +++ b/sm2/.gitmodules
+ @@ -0,0 +1,3 @@
+ +[submodule "nested"]
+ + path = nested
+ + url = ../sm2
+ Submodule nested 0000000...b55928c (new submodule)
+ diff --git a/sm2/nested/file b/sm2/nested/file
+ new file mode 100644
+ index 0000000..ca281f5
+ --- /dev/null
+ +++ b/sm2/nested/file
+ @@ -0,0 +1 @@
+ +nested content
+ diff --git a/sm2/nested/foo8 b/sm2/nested/foo8
+ new file mode 100644
+ index 0000000..db9916b
+ --- /dev/null
+ +++ b/sm2/nested/foo8
+ @@ -0,0 +1 @@
+ +foo8
+ diff --git a/sm2/nested/foo9 b/sm2/nested/foo9
+ new file mode 100644
+ index 0000000..9c3b4f6
+ --- /dev/null
+ +++ b/sm2/nested/foo9
+ @@ -0,0 +1 @@
+ +foo9
+ EOF
+ git diff --submodule=diff >actual 2>err &&
+ test_must_be_empty err &&
+ test_cmp expected actual
+'
+
test_done