aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-02 13:36:54 -0800
committerJunio C Hamano <gitster@pobox.com>2017-02-02 13:36:54 -0800
commit1e6a89323b57888d5464732ea7a56a5fd385318b (patch)
tree6cbc07e63f23e720ab3da3068c997d2ec9d169cd /t
parent8f60064c1f538f06e1c579cbd9840b86b10bcd3d (diff)
parent619acfc78c526bc9df17b7704e60d0512ab7a84c (diff)
downloadgit-1e6a89323b57888d5464732ea7a56a5fd385318b.tar.gz
git-1e6a89323b57888d5464732ea7a56a5fd385318b.tar.xz
Merge branch 'sb/submodule-add-force'
"git submodule add" used to be confused and refused to add a locally created repository; users can now use "--force" option to add them. * sb/submodule-add-force: submodule add: extend force flag to add existing repos
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index b77cce8e4..c09ce0d4c 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -152,6 +152,20 @@ test_expect_success 'submodule add to .gitignored path with --force' '
)
'
+test_expect_success 'submodule add to reconfigure existing submodule with --force' '
+ (
+ cd addtest-ignore &&
+ git submodule add --force bogus-url submod &&
+ git submodule add -b initial "$submodurl" submod-branch &&
+ test "bogus-url" = "$(git config -f .gitmodules submodule.submod.url)" &&
+ test "bogus-url" = "$(git config submodule.submod.url)" &&
+ # Restore the url
+ git submodule add --force "$submodurl" submod
+ test "$submodurl" = "$(git config -f .gitmodules submodule.submod.url)" &&
+ test "$submodurl" = "$(git config submodule.submod.url)"
+ )
+'
+
test_expect_success 'submodule add --branch' '
echo "refs/heads/initial" >expect-head &&
cat <<-\EOF >expect-heads &&