aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2007-08-15 19:22:09 +0200
committerJunio C Hamano <gitster@pobox.com>2007-08-15 21:39:07 -0700
commite06c5a6c7bdaa8c96b72e29f7fb49a331f1e0cc2 (patch)
tree0e2bd1bc594b9f1b8787bdd6b7a8f18b770ada4f /t
parentda899deb24ff66ec2166389516a915c01bf0a387 (diff)
downloadgit-e06c5a6c7bdaa8c96b72e29f7fb49a331f1e0cc2.tar.gz
git-e06c5a6c7bdaa8c96b72e29f7fb49a331f1e0cc2.tar.xz
git-apply: apply submodule changes
Apply "Subproject commit HEX" changes produced by git-diff. As usual in the current git, only the superproject itself is actually modified (possibly creating empty directories for new submodules). Any checked-out submodule is left untouched and is not required to be up-to-date. With clean-ups from Junio C Hamano. Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index e8ce7cdb8..9d142ed64 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -175,4 +175,21 @@ test_expect_success 'checkout superproject with subproject already present' '
git-checkout master
'
+test_expect_success 'apply submodule diff' '
+ git branch second &&
+ (
+ cd lib &&
+ echo s >s &&
+ git add s &&
+ git commit -m "change subproject"
+ ) &&
+ git update-index --add lib &&
+ git-commit -m "change lib" &&
+ git-format-patch -1 --stdout >P.diff &&
+ git checkout second &&
+ git apply --index P.diff &&
+ D=$(git diff --cached master) &&
+ test -z "$D"
+'
+
test_done