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 <emaste@freebsd.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ed Maste committed
Jun 17, 2016 at 11:33 UTC
9b35cadc2c7660745264041317f5982e1dde3f88
3 files changed
+6
-6
git-rebase--am.sh
+2
-2
@@ -9,8 +9,8 @@
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".
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".
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 () {
git-rebase--interactive.sh
+2
-2
@@ -838,8 +838,8 @@ add_exec_commands () {
838
# below were not inside any function, and expected to return
839
# to the function that dot-sourced us.
840
#
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".
843
# As a work-around, we introduce an extra layer of a function
844
# here, and immediately call it after defining it.
845
git_rebase__interactive () {
git-rebase--merge.sh
+2
-2
@@ -107,8 +107,8 @@ finish_rb_merge () {
107
# below were not inside any function, and expected to return
108
# to the function that dot-sourced us.
109
#
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".
112
# As a work-around, we introduce an extra layer of a function
113
# here, and immediately call it after defining it.
114
git_rebase__merge () {