summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2018-05-15 10:15:18 -0400
committerLibravatar Jeff King <peff@peff.net>2018-05-21 23:54:28 -0400
commiteedd5949f5a6b1bb86726051d0916421cdbb5dcd (patch)
treed2f35c7391332f53d4126206b8ed20d50c870db7 /git-submodule.sh
parentGit 2.17 (diff)
parentverify_path: disallow symlinks in .gitmodules (diff)
downloadtgif-eedd5949f5a6b1bb86726051d0916421cdbb5dcd.tar.xz
Merge branch 'jk/submodule-name-verify-fix' into jk/submodule-name-verify-fsck
* jk/submodule-name-verify-fix: verify_path: disallow symlinks in .gitmodules update-index: stat updated files earlier verify_path: drop clever fallthrough skip_prefix: add icase-insensitive variant is_{hfs,ntfs}_dotgitmodules: add tests path: match NTFS short names for more .git files is_hfs_dotgit: match other .git files is_ntfs_dotgit: use a size_t for traversing string submodule-config: verify submodule names as paths Note that this includes two bits of evil-merge: - there's a new call to verify_path() that doesn't actually have a mode available. It should be OK to pass "0" here, since we're just manipulating the untracked cache, not an actual index entry. - the lstat() in builtin/update-index.c:update_one() needs to be updated to handle the fsmonitor case (without this it still behaves correctly, but does an unnecessary lstat).
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 24914963ca..7e27d0a0da 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -229,6 +229,11 @@ Use -f if you really want to add it." >&2
sm_name="$sm_path"
fi
+ if ! git submodule--helper check-name "$sm_name"
+ then
+ die "$(eval_gettext "'$sm_name' is not a valid submodule name")"
+ fi
+
# perhaps the path exists and is already a git repo, else clone it
if test -e "$sm_path"
then