Skip to content

Commit

Permalink
Merge branch 'jl/submodule-re-add' into maint
Browse files Browse the repository at this point in the history
* jl/submodule-re-add:
  submodule add: fix breakage when re-adding a deep submodule
  • Loading branch information
Junio C Hamano committed Feb 10, 2012
2 parents 38ca63f + 1017c1a commit 5febbda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions git-submodule.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions t/t7406-submodule-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5febbda

Please sign in to comment.