aboutsummaryrefslogtreecommitdiff
path: root/t/t7400-submodule-basic.sh
diff options
context:
space:
mode:
authorW. Trevor King <wking@tremily.us>2012-12-19 11:03:33 -0500
committerJunio C Hamano <gitster@pobox.com>2012-12-19 09:40:51 -0800
commitb928922727d6691a3bdc28160f93f25712c565f6 (patch)
tree2030ba639d8a6f5e579e87478ecbbd807074bf6b /t/t7400-submodule-basic.sh
parent06b1abb5bd38b3cb1972907b059c7f95a197a7a5 (diff)
downloadgit-b928922727d6691a3bdc28160f93f25712c565f6.tar.gz
git-b928922727d6691a3bdc28160f93f25712c565f6.tar.xz
submodule add: If --branch is given, record it in .gitmodules
This allows you to easily record a submodule.<name>.branch option in .gitmodules when you add a new submodule. With this patch, $ git submodule add -b <branch> <repository> [<path>] $ git config -f .gitmodules submodule.<path>.branch <branch> reduces to $ git submodule add -b <branch> <repository> [<path>] This means that future calls to $ git submodule update --remote ... will get updates from the same branch that you used to initialize the submodule, which is usually what you want. Signed-off-by: W. Trevor King <wking@tremily.us> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index de7d45352..2683cba7e 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -133,6 +133,7 @@ test_expect_success 'submodule add --branch' '
(
cd addtest &&
git submodule add -b initial "$submodurl" submod-branch &&
+ test "initial" = "$(git config -f .gitmodules submodule.submod-branch.branch)" &&
git submodule init
) &&