diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-15 10:28:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-15 10:28:44 -0700 |
commit | 3bb6149186ea6bed5e6fd7b2f830fb499a1a8658 (patch) | |
tree | 66ddba88750eec50e0418b55c3eb1450a3ed37da /t | |
parent | Merge branch 'jk/format-patch-from' (diff) | |
parent | submodule update: allow custom command to update submodule working tree (diff) | |
download | tgif-3bb6149186ea6bed5e6fd7b2f830fb499a1a8658.tar.xz |
Merge branch 'cp/submodule-custom-update'
In addition to the choice from "rebase, merge, or checkout-detach",
allow a custom command to be used in "submodule update" to update
the working tree of submodules.
* cp/submodule-custom-update:
submodule update: allow custom command to update submodule working tree
Diffstat (limited to 't')
-rwxr-xr-x | t/t7406-submodule-update.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index cdb0538392..bc7cfcd835 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -294,6 +294,35 @@ test_expect_success 'submodule update - checkout in .git/config' ' ) ' +test_expect_success 'submodule update - command in .git/config' ' + (cd super && + git config submodule.submodule.update "!git checkout" + ) && + (cd super/submodule && + git reset --hard HEAD^ + ) && + (cd super && + (cd submodule && + compare_head + ) && + git submodule update submodule && + cd submodule && + ! compare_head + ) +' + +test_expect_success 'submodule update - command in .git/config catches failure' ' + (cd super && + git config submodule.submodule.update "!false" + ) && + (cd super/submodule && + git reset --hard HEAD^ + ) && + (cd super && + test_must_fail git submodule update submodule + ) +' + test_expect_success 'submodule init picks up rebase' ' (cd super && git config -f .gitmodules submodule.rebasing.update rebase && |