2011-02-06 19:43:48 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2010 Junio C Hamano.
|
|
|
|
#
|
|
|
|
|
|
|
|
. git-sh-setup
|
|
|
|
|
|
|
|
case "$action" in
|
|
|
|
continue)
|
2011-02-06 19:43:58 +01:00
|
|
|
git am --resolved --resolvemsg="$resolvemsg" &&
|
2011-02-06 19:43:48 +01:00
|
|
|
move_to_original_branch
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
skip)
|
2011-02-06 19:43:58 +01:00
|
|
|
git am --skip --resolvemsg="$resolvemsg" &&
|
2011-02-06 19:43:48 +01:00
|
|
|
move_to_original_branch
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
test -n "$rebase_root" && root_flag=--root
|
|
|
|
|
2012-04-20 16:36:17 +02:00
|
|
|
if test -n "$keep_empty"
|
|
|
|
then
|
|
|
|
# we have to do this the hard way. git format-patch completely squashes
|
|
|
|
# empty commits and even if it didn't the format doesn't really lend
|
|
|
|
# itself well to recording empty patches. fortunately, cherry-pick
|
|
|
|
# makes this easy
|
|
|
|
git cherry-pick --allow-empty "$revisions"
|
|
|
|
else
|
|
|
|
git format-patch -k --stdout --full-index --ignore-if-in-upstream \
|
|
|
|
--src-prefix=a/ --dst-prefix=b/ \
|
|
|
|
--no-renames $root_flag "$revisions" |
|
|
|
|
git am $git_am_opt --rebasing --resolvemsg="$resolvemsg"
|
|
|
|
fi && move_to_original_branch
|
|
|
|
|
2011-02-06 19:43:48 +01:00
|
|
|
ret=$?
|
2011-02-06 19:43:53 +01:00
|
|
|
test 0 != $ret -a -d "$state_dir" && write_basic_state
|
2011-02-06 19:43:48 +01:00
|
|
|
exit $ret
|