File tree Expand file tree Collapse file tree 4 files changed +46
-10
lines changed Expand file tree Collapse file tree 4 files changed +46
-10
lines changed Original file line number Diff line number Diff line change 4
4
# Copyright (c) 2010 Junio C Hamano.
5
5
#
6
6
7
+ # The whole contents of this file is run by dot-sourcing it from
8
+ # inside a shell function. It used to be that "return"s we see
9
+ # below were not inside any function, and expected to return
10
+ # to the function that dot-sourced us.
11
+ #
12
+ # However, FreeBSD /bin/sh misbehaves on such a construct and
13
+ # continues to run the statements that follow such a "return".
14
+ # As a work-around, we introduce an extra layer of a function
15
+ # here, and immediately call it after defining it.
16
+ git_rebase__am () {
17
+
7
18
case " $action " in
8
19
continue)
9
20
git am --resolved --resolvemsg=" $resolvemsg " \
75
86
fi
76
87
77
88
move_to_original_branch
89
+
90
+ }
91
+ # ... and then we call the whole thing.
92
+ git_rebase__am
Original file line number Diff line number Diff line change @@ -820,6 +820,17 @@ add_exec_commands () {
820
820
mv " $1 .new" " $1 "
821
821
}
822
822
823
+ # The whole contents of this file is run by dot-sourcing it from
824
+ # inside a shell function. It used to be that "return"s we see
825
+ # below were not inside any function, and expected to return
826
+ # to the function that dot-sourced us.
827
+ #
828
+ # However, FreeBSD /bin/sh misbehaves on such a construct and
829
+ # continues to run the statements that follow such a "return".
830
+ # As a work-around, we introduce an extra layer of a function
831
+ # here, and immediately call it after defining it.
832
+ git_rebase__interactive () {
833
+
823
834
case " $action " in
824
835
continue)
825
836
# do we have anything to commit?
@@ -1055,3 +1066,7 @@ GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name"
1055
1066
output git checkout $onto || die_abort " could not detach HEAD"
1056
1067
git update-ref ORIG_HEAD $orig_head
1057
1068
do_rest
1069
+
1070
+ }
1071
+ # ... and then we call the whole thing.
1072
+ git_rebase__interactive
Original file line number Diff line number Diff line change @@ -101,6 +101,17 @@ finish_rb_merge () {
101
101
say All done.
102
102
}
103
103
104
+ # The whole contents of this file is run by dot-sourcing it from
105
+ # inside a shell function. It used to be that "return"s we see
106
+ # below were not inside any function, and expected to return
107
+ # to the function that dot-sourced us.
108
+ #
109
+ # However, FreeBSD /bin/sh misbehaves on such a construct and
110
+ # continues to run the statements that follow such a "return".
111
+ # As a work-around, we introduce an extra layer of a function
112
+ # here, and immediately call it after defining it.
113
+ git_rebase__merge () {
114
+
104
115
case " $action " in
105
116
continue)
106
117
read_state
151
162
done
152
163
153
164
finish_rb_merge
165
+
166
+ }
167
+ # ... and then we call the whole thing.
168
+ git_rebase__merge
Original file line number Diff line number Diff line change @@ -175,22 +175,13 @@ You can run "git stash pop" or "git stash drop" at any time.
175
175
rm -rf " $state_dir "
176
176
}
177
177
178
- run_specific_rebase_internal () {
178
+ run_specific_rebase () {
179
179
if [ " $interactive_rebase " = implied ]; then
180
180
GIT_EDITOR=:
181
181
export GIT_EDITOR
182
182
autosquash=
183
183
fi
184
- # On FreeBSD, the shell's "return" returns from the current
185
- # function, not from the current file inclusion.
186
- # run_specific_rebase_internal has the file inclusion as a
187
- # last statement, so POSIX and FreeBSD's return will do the
188
- # same thing.
189
184
. git-rebase--$type
190
- }
191
-
192
- run_specific_rebase () {
193
- run_specific_rebase_internal
194
185
ret=$?
195
186
if test $ret -eq 0
196
187
then
You can’t perform that action at this time.
0 commit comments