summaryrefslogtreecommitdiff
path: root/git-submodule.sh
diff options
context:
space:
mode:
authorLibravatar Jonathan Nieder <jrnieder@gmail.com>2010-12-01 12:50:46 -0600
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-12-06 16:41:44 -0800
commit502dc5b663fe3fe241accca5eda28a94d674fbb6 (patch)
tree511ad4b094770ed76222d3559f5da6434c5f9e3b /git-submodule.sh
parentGit 1.7.3 (diff)
downloadtgif-502dc5b663fe3fe241accca5eda28a94d674fbb6.tar.xz
git submodule -b ... of current HEAD fails
git submodule add -b $branch $repository fails when HEAD already points to $branch in $repository. Reported-by: Klaus Ethgen <Klaus@Ethgen.de> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-submodule.sh')
-rwxr-xr-xgit-submodule.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/git-submodule.sh b/git-submodule.sh
index 9ebbab798d..09107467fe 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -241,7 +241,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