diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2012-05-14 20:24:45 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-14 22:56:42 +0400 |
commit | 5e73633dbf8a62190611f6eb438a1a2eaaffa919 (patch) | |
tree | 3b4d75ea58902847c8313ef9abdb5c64fea8d09a /t | |
parent | d0f1ea6003d97e63110fa7d50bb07f546a909b6e (diff) |
teach add_submodule_odb() to look for alternates
Since we allow to link other object databases when loading a submodules
database we should also load possible alternates.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t4041-diff-submodule-option.sh | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index bf9a7526bd3..6c01d0c056e 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -458,4 +458,38 @@ EOF test_cmp expected actual ' +test_expect_success 'diff --submodule with objects referenced by alternates' ' + mkdir sub_alt && + (cd sub_alt && + git init && + echo a >a && + git add a && + git commit -m a + ) && + mkdir super && + (cd super && + git clone -s ../sub_alt sub && + git init && + git add sub && + git commit -m "sub a" + ) && + (cd sub_alt && + sha1_before=$(git rev-parse --short HEAD) + echo b >b && + git add b && + git commit -m b + sha1_after=$(git rev-parse --short HEAD) + echo "Submodule sub $sha1_before..$sha1_after: + > b" >../expected + ) && + (cd super && + (cd sub && + git fetch && + git checkout origin/master + ) && + git diff --submodule > ../actual + ) + test_cmp expected actual +' + test_done |