Skip to content

Commit 502dc5b

Browse files
jrngitster
authored andcommitted
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 <[email protected]> Signed-off-by: Jonathan Nieder <[email protected]> Acked-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 87b5054 commit 502dc5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-submodule.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ cmd_add()
241241
# ash fails to wordsplit ${branch:+-b "$branch"...}
242242
case "$branch" in
243243
'') git checkout -f -q ;;
244-
?*) git checkout -f -q -b "$branch" "origin/$branch" ;;
244+
?*) git checkout -f -q -B "$branch" "origin/$branch" ;;
245245
esac
246246
) || die "Unable to checkout submodule '$path'"
247247
fi

0 commit comments

Comments
 (0)