git-diff: don't squelch the new SHA1 in submodule diffs
The code to squelch empty diffs introduced by commit
fb13227e08
would inadvertently
populate filespec "two" of a submodule change using the uninitialized
(null) SHA1, thereby replacing the submodule SHA1 by 0{40} in the output.
This change teaches diffcore_skip_stat_unmatch to handle
submodule changes correctly.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a51cdb0c04
commit
5701115aa7
@ -152,6 +152,10 @@ test_expect_success 'the --cached sha1 should be rev1' '
|
||||
git-submodule --cached status | grep "^+$rev1"
|
||||
'
|
||||
|
||||
test_expect_success 'git diff should report the SHA1 of the new submodule commit' '
|
||||
git-diff | grep "^+Subproject commit $rev2"
|
||||
'
|
||||
|
||||
test_expect_success 'update should checkout rev1' '
|
||||
git-submodule update &&
|
||||
head=$(cd lib && git rev-parse HEAD) &&
|
||||
|
Reference in New Issue
Block a user