summaryrefslogtreecommitdiff
path: root/t/t7406-submodule-update.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-04-04 15:02:01 -0700
committerJunio C Hamano <gitster@pobox.com>2011-04-04 15:02:01 -0700
commit2071fb015bc673d2514142d7614b56a37b3faaf2 (patch)
tree8bd133ee781324212c8ebc395178d20707082ae2 /t/t7406-submodule-update.sh
parent2c320e71bfae3d2972d41680a04b78cbd42cb941 (diff)
parent794a3592ad9d8a9b273f6496052bbcb46b1924ed (diff)
downloadgit-2071fb015bc673d2514142d7614b56a37b3faaf2.tar.gz
Merge branch 'jl/submodule-fetch-on-demand'
* jl/submodule-fetch-on-demand: fetch/pull: Describe --recurse-submodule restrictions in the BUGS section submodule update: Don't fetch when the submodule commit is already present fetch/pull: Don't recurse into a submodule when commits are already present Submodules: Add 'on-demand' value for the 'fetchRecurseSubmodule' option config: teach the fetch.recurseSubmodules option the 'on-demand' value fetch/pull: Add the 'on-demand' value to the --recurse-submodules option fetch/pull: recurse into submodules when necessary Conflicts: builtin/fetch.c submodule.c
Diffstat (limited to 't/t7406-submodule-update.sh')
-rwxr-xr-xt/t7406-submodule-update.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index fa9d23aa31..bf7c788735 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -74,6 +74,26 @@ test_expect_success 'submodule update detaching the HEAD ' '
)
'
+apos="'";
+test_expect_success 'submodule update does not fetch already present commits' '
+ (cd submodule &&
+ echo line3 >> file &&
+ git add file &&
+ test_tick &&
+ git commit -m "upstream line3"
+ ) &&
+ (cd super/submodule &&
+ head=$(git rev-parse --verify HEAD) &&
+ echo "Submodule path ${apos}submodule$apos: checked out $apos$head$apos" > ../../expected &&
+ git reset --hard HEAD~1
+ ) &&
+ (cd super &&
+ git submodule update > ../actual 2> ../actual.err
+ ) &&
+ test_cmp expected actual &&
+ ! test -s actual.err
+'
+
test_expect_success 'submodule update --rebase staying on master' '
(cd super/submodule &&
git checkout master