diff options
author | Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> | 2011-02-06 13:43:48 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-02-10 14:08:09 -0800 |
commit | 46df82d5fa0f83d3c1108ad70248877d6d9b56bb (patch) | |
tree | d7780e36c5474554404623e7bcec67bd15e7b47b /git-rebase.sh | |
parent | fa99c1e1e16d347a354c817d96c5abbd5a08fcd8 (diff) | |
download | git-46df82d5fa0f83d3c1108ad70248877d6d9b56bb.tar.gz |
rebase: extract am code to new source file
Extract the code for am-based rebase to git-rebase--am.sh.
Suggested-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase.sh')
-rwxr-xr-x | git-rebase.sh | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/git-rebase.sh b/git-rebase.sh index 44e169fe15..c60221b5a4 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -91,7 +91,7 @@ run_specific_rebase () { GIT_EDITOR=: export GIT_EDITOR fi - test "$type" != am && . git-rebase--$type + . git-rebase--$type } run_pre_rebase_hook () { @@ -261,17 +261,11 @@ continue) } read_basic_state run_specific_rebase - git am --resolved --3way --resolvemsg="$resolvemsg" && - move_to_original_branch - exit ;; skip) git reset --hard HEAD || exit $? read_basic_state run_specific_rebase - git am -3 --skip --resolvemsg="$resolvemsg" && - move_to_original_branch - exit ;; abort) git rerere clear @@ -324,14 +318,12 @@ then shift upstream=`git rev-parse --verify "${upstream_name}^0"` || die "invalid upstream $upstream_name" - unset root_flag upstream_arg="$upstream_name" else test -z "$onto" && die "You must specify --onto when using --root" unset upstream_name unset upstream - root_flag="--root" - upstream_arg="$root_flag" + upstream_arg=--root fi # Make sure the branch to rebase onto is valid. @@ -457,23 +449,4 @@ else revisions="$upstream..$orig_head" fi -if test -z "$do_merge" -then - 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" && - move_to_original_branch - ret=$? - test 0 != $ret -a -d "$apply_dir" && - echo $head_name > "$apply_dir/head-name" && - echo $onto > "$apply_dir/onto" && - echo $orig_head > "$apply_dir/orig-head" && - echo "$GIT_QUIET" > "$apply_dir/quiet" - exit $ret -fi - -# start doing a rebase with git-merge -# this is rename-aware if the recursive (default) strategy is used - run_specific_rebase |