Skip to content

Commit 9b35cad

Browse files
emastegitster
authored andcommitted
rebase: update comment about FreeBSD /bin/sh
Commit 9f50d32 introduced a fix for FreeBSD /bin/sh misbehaviour when dot-sourcing a file containing "return" statements outside of any function, from a function in another shell script. That issue affects FreeBSD 9.x, and is not present in the /bin/sh in FreeBSD 10.3 and later. Update the comment to clarify this. The example from 9f50d32's commit message produces the expected output on FreeBSD 10.3 and -CURRENT (the upcoming 11.0): % sh script1.sh only this line should show % Signed-off-by: Ed Maste <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7654286 commit 9b35cad

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

git-rebase--am.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# below were not inside any function, and expected to return
1010
# to the function that dot-sourced us.
1111
#
12-
# However, FreeBSD /bin/sh misbehaves on such a construct and
13-
# continues to run the statements that follow such a "return".
12+
# However, older (9.x) versions of FreeBSD /bin/sh misbehave on such a
13+
# construct and continue to run the statements that follow such a "return".
1414
# As a work-around, we introduce an extra layer of a function
1515
# here, and immediately call it after defining it.
1616
git_rebase__am () {

git-rebase--interactive.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,8 +838,8 @@ add_exec_commands () {
838838
# below were not inside any function, and expected to return
839839
# to the function that dot-sourced us.
840840
#
841-
# However, FreeBSD /bin/sh misbehaves on such a construct and
842-
# continues to run the statements that follow such a "return".
841+
# However, older (9.x) versions of FreeBSD /bin/sh misbehave on such a
842+
# construct and continue to run the statements that follow such a "return".
843843
# As a work-around, we introduce an extra layer of a function
844844
# here, and immediately call it after defining it.
845845
git_rebase__interactive () {

git-rebase--merge.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ finish_rb_merge () {
107107
# below were not inside any function, and expected to return
108108
# to the function that dot-sourced us.
109109
#
110-
# However, FreeBSD /bin/sh misbehaves on such a construct and
111-
# continues to run the statements that follow such a "return".
110+
# However, older (9.x) versions of FreeBSD /bin/sh misbehave on such a
111+
# construct and continue to run the statements that follow such a "return".
112112
# As a work-around, we introduce an extra layer of a function
113113
# here, and immediately call it after defining it.
114114
git_rebase__merge () {

0 commit comments

Comments
 (0)