]> git.ipfire.org Git - thirdparty/git.git/blame - git-rebase--am.sh
GIT-VERSION-GEN: support non-standard $GIT_DIR path
[thirdparty/git.git] / git-rebase--am.sh
CommitLineData
46df82d5
MZ
1#!/bin/sh
2#
3# Copyright (c) 2010 Junio C Hamano.
4#
5
46df82d5
MZ
6case "$action" in
7continue)
c5e610be 8 git am --resolved --resolvemsg="$resolvemsg" &&
46df82d5
MZ
9 move_to_original_branch
10 exit
11 ;;
12skip)
c5e610be 13 git am --skip --resolvemsg="$resolvemsg" &&
46df82d5
MZ
14 move_to_original_branch
15 exit
16 ;;
17esac
18
19test -n "$rebase_root" && root_flag=--root
20
90e1818f
NH
21if test -n "$keep_empty"
22then
23 # we have to do this the hard way. git format-patch completely squashes
24 # empty commits and even if it didn't the format doesn't really lend
25 # itself well to recording empty patches. fortunately, cherry-pick
26 # makes this easy
27 git cherry-pick --allow-empty "$revisions"
28else
29 git format-patch -k --stdout --full-index --ignore-if-in-upstream \
30 --src-prefix=a/ --dst-prefix=b/ \
31 --no-renames $root_flag "$revisions" |
32 git am $git_am_opt --rebasing --resolvemsg="$resolvemsg"
33fi && move_to_original_branch
34
46df82d5 35ret=$?
84df4560 36test 0 != $ret -a -d "$state_dir" && write_basic_state
46df82d5 37exit $ret