aboutsummaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-12-16 12:49:22 -0800
committerJunio C Hamano <gitster@pobox.com>2010-12-16 12:49:22 -0800
commit7eaf4af426ee29812d49cfa5328e2af8b3f8af95 (patch)
tree475a6e667c27a29565510d311ab72ec284755e3f /git-submodule.sh
parentc835288be4cac722a20f9601a920879206a0ff61 (diff)
parent69e7236c6df44bfcde8913972b75a6ccb360d58f (diff)
downloadgit-7eaf4af426ee29812d49cfa5328e2af8b3f8af95.tar.gz
git-7eaf4af426ee29812d49cfa5328e2af8b3f8af95.tar.xz
Merge branch 'jn/submodule-b-current'
* jn/submodule-b-current: git submodule: Remove now obsolete tests before cloning a repo git submodule -b ... of current HEAD fails
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh16
1 files changed, 1 insertions, 15 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 33bc41f06..c21b77aee 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -93,20 +93,6 @@ module_clone()
url=$2
reference="$3"
- # If there already is a directory at the submodule path,
- # expect it to be empty (since that is the default checkout
- # action) and try to remove it.
- # Note: if $path is a symlink to a directory the test will
- # succeed but the rmdir will fail. We might want to fix this.
- if test -d "$path"
- then
- rmdir "$path" 2>/dev/null ||
- die "Directory '$path' exists, but is neither empty nor a git repository"
- fi
-
- test -e "$path" &&
- die "A file already exist at path '$path'"
-
if test -n "$reference"
then
git-clone "$reference" -n "$url" "$path"
@@ -241,7 +227,7 @@ cmd_add()
# ash fails to wordsplit ${branch:+-b "$branch"...}
case "$branch" in
'') git checkout -f -q ;;
- ?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
+ ?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
esac
) || die "Unable to checkout submodule '$path'"
fi