Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-11-01 18:38:26 +0400
committerJunio C Hamano <gitster@pobox.com>2013-11-01 18:38:27 +0400
commit9dd860c8562917dbbdd595d5f9997b6856dbeb0a (patch)
tree144744d5287fbea0e785e3148783a11571acb20e /t
parent42817b96b1b80b56fd5a4d5e0d6239524b1832a3 (diff)
parent04c1ee576accad4d0a04f168b86992aba0a6727d (diff)
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 &&