@matheusbsbs / matheus-bagliano / commits / 502dc5b663
Fork 0

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>

Jonathan Nieder committed Dec 1, 2010 at 12:50 UTC 502dc5b663fe3fe241accca5eda28a94d674fbb6
1 file changed +1 -1
git-submodule.sh
+1 -1
@@ -241,7 +241,7 @@ cmd_add()
241 # ash fails to wordsplit ${branch:+-b "$branch"...}
242 case "$branch" in
243 '') git checkout -f -q ;;
244 - ?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
244 + ?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
245 esac
246 ) || die "Unable to checkout submodule '$path'"
247 fi