summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-11-01 07:38:26 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-11-01 07:38:27 -0700
commit9dd860c8562917dbbdd595d5f9997b6856dbeb0a (patch)
tree144744d5287fbea0e785e3148783a11571acb20e /t
parentGit 1.8.5-rc0 (diff)
parentmv: Fix spurious warning when moving a file in presence of submodules (diff)
downloadtgif-9dd860c8562917dbbdd595d5f9997b6856dbeb0a.tar.xz
Merge branch 'jl/submodule-mv'
Moving a regular file in a repository with a .gitmodules file was producing a warning 'Could not find section in .gitmodules where path=<filename>'. * jl/submodule-mv: mv: Fix spurious warning when moving a file in presence of submodules
Diffstat (limited to 't')
-rwxr-xr-xt/t7001-mv.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index d432f42bcb..b90e985a48 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -293,6 +293,32 @@ test_expect_success 'git mv moves a submodule with a .git directory and no .gitm
git diff-files --quiet
'
+test_expect_success 'git mv moves a submodule with a .git directory and .gitmodules' '
+ rm -rf mod &&
+ git reset --hard &&
+ git submodule update &&
+ entry="$(git ls-files --stage sub | cut -f 1)" &&
+ (
+ cd sub &&
+ rm -f .git &&
+ cp -a ../.git/modules/sub .git &&
+ GIT_WORK_TREE=. git config --unset core.worktree
+ ) &&
+ mkdir mod &&
+ git mv sub mod/sub &&
+ ! test -e sub &&
+ [ "$entry" = "$(git ls-files --stage mod/sub | cut -f 1)" ] &&
+ (
+ cd mod/sub &&
+ git status
+ ) &&
+ echo mod/sub >expected &&
+ git config -f .gitmodules submodule.sub.path >actual &&
+ test_cmp expected actual &&
+ git update-index --refresh &&
+ git diff-files --quiet
+'
+
test_expect_success 'git mv moves a submodule with gitfile' '
rm -rf mod/sub &&
git reset --hard &&