From 502dc5b663fe3fe241accca5eda28a94d674fbb6 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Wed, 1 Dec 2010 12:50:46 -0600 Subject: [PATCH] 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 --- git-submodule.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2