From 100d3819461920a8f6e6d782171e842b50ab1a7b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 11 Aug 2010 15:45:15 +0200 Subject: [PATCH] rebasing-merge: require --force to rebase without new upstream commits Signed-off-by: Johannes Schindelin --- share/msysGit/rebasing-merge.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/share/msysGit/rebasing-merge.sh b/share/msysGit/rebasing-merge.sh index 086029de..46dbc7b6 100755 --- a/share/msysGit/rebasing-merge.sh +++ b/share/msysGit/rebasing-merge.sh @@ -1,7 +1,16 @@ #!/bin/sh +force= +case "$1" in -f|--force) shift; force=t;; esac + TO=${1:-junio/next} +if test -z "$force" && test -z "$(git rev-list .."$TO")" +then + echo "Nothing new in $TO; To force a rebase, use the --force, Luke!" >&2 + exit 1 +fi + TODO_EXTRA="$(git rev-parse --git-dir)/todo-extra" # Rebase 'devel' on top of 'junio/next', the merging the old state of -- 2.11.4.GIT