aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-06-20 21:51:13 -0700
committerJunio C Hamano <gitster@pobox.com>2009-06-20 21:51:13 -0700
commita49eb197d809d2d7efbd81d935c61e1a0caa983e (patch)
tree06512c227fba59faaee57dcfe1ba71f049c4d0a7 /t
parentc28a17f270a51a4ed5e432e83c0ed962361a37c9 (diff)
parent42b491786260eb17d97ea9fb1c4b70075bca9523 (diff)
downloadgit-a49eb197d809d2d7efbd81d935c61e1a0caa983e.tar.gz
git-a49eb197d809d2d7efbd81d935c61e1a0caa983e.tar.xz
Merge branch 'ph/submodule-rebase'
* ph/submodule-rebase: git-submodule: add support for --merge. Conflicts: Documentation/git-submodule.txt git-submodule.sh
Diffstat (limited to 't')
-rwxr-xr-xt/t7406-submodule-update.sh60
1 files changed, 59 insertions, 1 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index 0773fe405..2d33d9efe 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -6,7 +6,7 @@
test_description='Test updating submodules
This test verifies that "git submodule update" detaches the HEAD of the
-submodule and "git submodule update --rebase" does not detach the HEAD.
+submodule and "git submodule update --rebase/--merge" does not detach the HEAD.
'
. ./test-lib.sh
@@ -76,6 +76,20 @@ test_expect_success 'submodule update --rebase staying on master' '
)
'
+test_expect_success 'submodule update --merge staying on master' '
+ (cd super/submodule &&
+ git reset --hard HEAD~1
+ ) &&
+ (cd super &&
+ (cd submodule &&
+ compare_head
+ ) &&
+ git submodule update --merge submodule &&
+ cd submodule &&
+ compare_head
+ )
+'
+
test_expect_success 'submodule update - rebase in .git/config' '
(cd super &&
git config submodule.submodule.update rebase
@@ -110,6 +124,40 @@ test_expect_success 'submodule update - checkout in .git/config but --rebase giv
)
'
+test_expect_success 'submodule update - merge in .git/config' '
+ (cd super &&
+ git config submodule.submodule.update merge
+ ) &&
+ (cd super/submodule &&
+ git reset --hard HEAD~1
+ ) &&
+ (cd super &&
+ (cd submodule &&
+ compare_head
+ ) &&
+ git submodule update submodule &&
+ cd submodule &&
+ compare_head
+ )
+'
+
+test_expect_success 'submodule update - checkout in .git/config but --merge given' '
+ (cd super &&
+ git config submodule.submodule.update checkout
+ ) &&
+ (cd super/submodule &&
+ git reset --hard HEAD~1
+ ) &&
+ (cd super &&
+ (cd submodule &&
+ compare_head
+ ) &&
+ git submodule update --merge submodule &&
+ cd submodule &&
+ compare_head
+ )
+'
+
test_expect_success 'submodule update - checkout in .git/config' '
(cd super &&
git config submodule.submodule.update checkout
@@ -137,4 +185,14 @@ test_expect_success 'submodule init picks up rebase' '
)
'
+test_expect_success 'submodule init picks up merge' '
+ (cd super &&
+ git config submodule.merging.url git://non-existing/git &&
+ git config submodule.merging.path does-not-matter &&
+ git config submodule.merging.update merge &&
+ git submodule init merging &&
+ test "merge" = $(git config submodule.merging.update)
+ )
+'
+
test_done