diff options
author | Junio C Hamano <gitster@pobox.com> | 2012-01-31 22:01:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-01-31 22:01:16 -0800 |
commit | 412a79f4cb5e660a2f1ba550363c20ae5f443a86 (patch) | |
tree | af666692d64a81cdb1b1e27d78b6a16a69123f71 | |
parent | 3e9e41659394fe5de085c90f4f86858062dfa47d (diff) | |
parent | 1017c1abcb6d733e1de83eb5a1cf7e1bf4ad6aca (diff) | |
download | git-412a79f4cb5e660a2f1ba550363c20ae5f443a86.tar.gz |
Merge branch 'jl/submodule-re-add'
* jl/submodule-re-add:
submodule add: fix breakage when re-adding a deep submodule
-rwxr-xr-x | git-submodule.sh | 1 | ||||
-rwxr-xr-x | t/t7406-submodule-update.sh | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh index 3adab93635..9bb2e13e92 100755 --- a/git-submodule.sh +++ b/git-submodule.sh @@ -131,6 +131,7 @@ module_clone() gitdir= gitdir_base= name=$(module_name "$path" 2>/dev/null) + test -n "$name" || name="$path" base_path=$(dirname "$path") gitdir=$(git rev-parse --git-dir) diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index 33b292b8a8..5b97222c48 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -611,4 +611,12 @@ test_expect_success 'submodule update places git-dir in superprojects git-dir re ) ' +test_expect_success 'submodule add properly re-creates deeper level submodules' ' + (cd super && + git reset --hard master && + rm -rf deeper/ && + git submodule add ../submodule deeper/submodule + ) +' + test_done |