From: Jonathan Nieder Date: Wed, 1 Dec 2010 18:50:46 +0000 (-0600) Subject: git submodule -b ... of current HEAD fails X-Git-Tag: v1.7.4-rc0~39^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=502dc5b663fe3fe241accca5eda28a94d674fbb6;p=git.git 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 Signed-off-by: Jonathan Nieder Acked-by: Jens Lehmann Signed-off-by: Junio C Hamano --- diff --git a/git-submodule.sh b/git-submodule.sh index 9ebbab798..09107467f 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