Skip to content

Commit 51b2ead

Browse files
jaysoffiangitster
authored andcommitted
disallow providing multiple upstream branches to rebase, pull --rebase
It does not make sense to provide multiple upstream branches to either git pull --rebase, or to git rebase, so disallow both. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b94ead7 commit 51b2ead

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

git-pull.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ case "$merge_head" in
171171
echo >&2 "Cannot merge multiple branches into empty head"
172172
exit 1
173173
fi
174+
if test true = "$rebase"
175+
then
176+
echo >&2 "Cannot rebase onto multiple branches"
177+
exit 1
178+
fi
174179
;;
175180
esac
176181

git-rebase.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ do
310310
esac
311311
shift
312312
done
313+
test $# -gt 2 && usage
313314

314315
# Make sure we do not have $GIT_DIR/rebase-apply
315316
if test -z "$do_merge"

0 commit comments

Comments
 (0)