~ubuntu-branches/debian/sid/git/sid

« back to all changes in this revision

Viewing changes to git-rebase--am.sh

  • Committer: Package Import Robot
  • Author(s): Jonathan Nieder
  • Date: 2013-06-12 07:50:53 UTC
  • mfrom: (1.2.19) (2.1.31 experimental)
  • Revision ID: package-import@ubuntu.com-20130612075053-uue9xe0dq0rvm44y
Tags: 1:1.8.3.1-1
* merge branch debian-experimental
* new upstream point release (see RelNotes/1.8.3.1.txt).
* debian/watch: use xz-compressed tarballs from kernel.org.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
# Copyright (c) 2010 Junio C Hamano.
4
4
#
5
5
 
6
 
. git-sh-setup
7
 
 
8
6
case "$action" in
9
7
continue)
10
8
        git am --resolved --resolvemsg="$resolvemsg" &&
20
18
 
21
19
test -n "$rebase_root" && root_flag=--root
22
20
 
23
 
git format-patch -k --stdout --full-index --ignore-if-in-upstream \
24
 
        --src-prefix=a/ --dst-prefix=b/ \
25
 
        --no-renames $root_flag "$revisions" |
26
 
git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" &&
 
21
ret=0
 
22
if test -n "$keep_empty"
 
23
then
 
24
        # we have to do this the hard way.  git format-patch completely squashes
 
25
        # empty commits and even if it didn't the format doesn't really lend
 
26
        # itself well to recording empty patches.  fortunately, cherry-pick
 
27
        # makes this easy
 
28
        git cherry-pick --allow-empty "$revisions"
 
29
        ret=$?
 
30
else
 
31
        rm -f "$GIT_DIR/rebased-patches"
 
32
 
 
33
        git format-patch -k --stdout --full-index --ignore-if-in-upstream \
 
34
                --src-prefix=a/ --dst-prefix=b/ --no-renames --no-cover-letter \
 
35
                $root_flag "$revisions" >"$GIT_DIR/rebased-patches"
 
36
        ret=$?
 
37
 
 
38
        if test 0 != $ret
 
39
        then
 
40
                rm -f "$GIT_DIR/rebased-patches"
 
41
                case "$head_name" in
 
42
                refs/heads/*)
 
43
                        git checkout -q "$head_name"
 
44
                        ;;
 
45
                *)
 
46
                        git checkout -q "$orig_head"
 
47
                        ;;
 
48
                esac
 
49
 
 
50
                cat >&2 <<-EOF
 
51
 
 
52
                git encountered an error while preparing the patches to replay
 
53
                these revisions:
 
54
 
 
55
                    $revisions
 
56
 
 
57
                As a result, git cannot rebase them.
 
58
                EOF
 
59
                exit $?
 
60
        fi
 
61
 
 
62
        git am $git_am_opt --rebasing --resolvemsg="$resolvemsg" <"$GIT_DIR/rebased-patches"
 
63
        ret=$?
 
64
 
 
65
        rm -f "$GIT_DIR/rebased-patches"
 
66
fi
 
67
 
 
68
if test 0 != $ret
 
69
then
 
70
        test -d "$state_dir" && write_basic_state
 
71
        exit $ret
 
72
fi
 
73
 
27
74
move_to_original_branch
28
 
ret=$?
29
 
test 0 != $ret -a -d "$state_dir" && write_basic_state
30
 
exit $ret