git-rebase.sh: Add check if rebase is in progress
"git rebase --continue" and friends gave nonsense errors when there is no rebase in progress. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
3b2bbe9b85
commit
cd5320f252
|
@ -150,6 +150,9 @@ while test $# != 0
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--continue)
|
--continue)
|
||||||
|
test -d "$dotest" -o -d .dotest ||
|
||||||
|
die "No rebase in progress?"
|
||||||
|
|
||||||
git diff-files --quiet --ignore-submodules || {
|
git diff-files --quiet --ignore-submodules || {
|
||||||
echo "You must edit all merge conflicts and then"
|
echo "You must edit all merge conflicts and then"
|
||||||
echo "mark them as resolved using git add"
|
echo "mark them as resolved using git add"
|
||||||
|
@ -178,6 +181,9 @@ do
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
--skip)
|
--skip)
|
||||||
|
test -d "$dotest" -o -d .dotest ||
|
||||||
|
die "No rebase in progress?"
|
||||||
|
|
||||||
git reset --hard HEAD || exit $?
|
git reset --hard HEAD || exit $?
|
||||||
if test -d "$dotest"
|
if test -d "$dotest"
|
||||||
then
|
then
|
||||||
|
@ -203,16 +209,16 @@ do
|
||||||
exit
|
exit
|
||||||
;;
|
;;
|
||||||
--abort)
|
--abort)
|
||||||
|
test -d "$dotest" -o -d .dotest ||
|
||||||
|
die "No rebase in progress?"
|
||||||
|
|
||||||
git rerere clear
|
git rerere clear
|
||||||
if test -d "$dotest"
|
if test -d "$dotest"
|
||||||
then
|
then
|
||||||
move_to_original_branch
|
move_to_original_branch
|
||||||
elif test -d .dotest
|
else
|
||||||
then
|
|
||||||
dotest=.dotest
|
dotest=.dotest
|
||||||
move_to_original_branch
|
move_to_original_branch
|
||||||
else
|
|
||||||
die "No rebase in progress?"
|
|
||||||
fi
|
fi
|
||||||
git reset --hard $(cat "$dotest/orig-head")
|
git reset --hard $(cat "$dotest/orig-head")
|
||||||
rm -r "$dotest"
|
rm -r "$dotest"
|
||||||
|
|
Loading…
Reference in New Issue