diff --git a/git-rebase.sh b/git-rebase.sh
index c43afe51abe065950f3d3ba2aa71bb157dd04bc8..e2d85eeeab79e60ef46a65cfee1fb4682dd4ba68 100755 (executable)
--- a/git-rebase.sh
+++ b/git-rebase.sh
fi
cmt=`cat "$dotest/current"`
fi
cmt=`cat "$dotest/current"`
- if ! git diff-index --quiet HEAD --
+ if ! git diff-index --quiet --ignore-submodules HEAD --
then
if ! git commit --no-verify -C "$cmt"
then
then
if ! git commit --no-verify -C "$cmt"
then
do
case "$1" in
--continue)
do
case "$1" in
--continue)
- git diff-files --quiet || {
+ test -d "$dotest" -o -d .dotest ||
+ die "No rebase in progress?"
+
+ git diff-files --quiet --ignore-submodules || {
echo "You must edit all merge conflicts and then"
echo "mark them as resolved using git add"
exit 1
echo "You must edit all merge conflicts and then"
echo "mark them as resolved using git add"
exit 1
exit
;;
--skip)
exit
;;
--skip)
+ test -d "$dotest" -o -d .dotest ||
+ die "No rebase in progress?"
+
git reset --hard HEAD || exit $?
if test -d "$dotest"
then
git reset --hard HEAD || exit $?
if test -d "$dotest"
then
exit
;;
--abort)
exit
;;
--abort)
+ test -d "$dotest" -o -d .dotest ||
+ die "No rebase in progress?"
+
git rerere clear
if test -d "$dotest"
then
move_to_original_branch
git rerere clear
if test -d "$dotest"
then
move_to_original_branch
- elif test -d .dotest
- then
+ else
dotest=.dotest
move_to_original_branch
dotest=.dotest
move_to_original_branch
- else
- die "No rebase in progress?"
fi
git reset --hard $(cat "$dotest/orig-head")
rm -r "$dotest"
fi
git reset --hard $(cat "$dotest/orig-head")
rm -r "$dotest"
fi
# The tree must be really really clean.
fi
# The tree must be really really clean.
-git update-index --refresh || exit
-diff=$(git diff-index --cached --name-status -r HEAD --)
+git update-index --ignore-submodules --refresh || exit
+diff=$(git diff-index --cached --name-status -r --ignore-submodules HEAD --)
case "$diff" in
?*) echo "cannot rebase: your index is not up-to-date"
echo "$diff"
case "$diff" in
?*) echo "cannot rebase: your index is not up-to-date"
echo "$diff"
mb=$(git merge-base "$onto" "$branch")
if test "$upstream" = "$onto" && test "$mb" = "$onto" &&
# linear history?
mb=$(git merge-base "$onto" "$branch")
if test "$upstream" = "$onto" && test "$mb" = "$onto" &&
# linear history?
- ! git rev-list --parents "$onto".."$branch" | grep " .* " > /dev/null
+ ! (git rev-list --parents "$onto".."$branch" | grep " .* ") > /dev/null
then
# Lazily switch to the target branch if needed...
test -z "$switch_to" || git checkout "$switch_to"
then
# Lazily switch to the target branch if needed...
test -z "$switch_to" || git checkout "$switch_to"