diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-05-08 10:01:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-05-08 10:01:06 -0700 |
commit | e79fcfcd3f95b1a6b4df11b889c69a80864354b0 (patch) | |
tree | 3edaf8c525e6ef917a844e39384c4df02d75888a /git-rebase--merge.sh | |
parent | e230cd861bc1c1cbb0743800d6ade853898a38db (diff) | |
parent | 8cd65967fe0084574fcee278a5f9ff3d14047c4f (diff) | |
download | git-e79fcfcd3f95b1a6b4df11b889c69a80864354b0.tar.gz |
Merge branch 'km/avoid-non-function-return-in-rebase' into maint
"git rebase" used a POSIX shell construct FreeBSD /bin/sh does not
work well with.
* km/avoid-non-function-return-in-rebase:
Revert "rebase: fix run_specific_rebase's use of "return" on FreeBSD"
rebase: avoid non-function use of "return" on FreeBSD
Diffstat (limited to 'git-rebase--merge.sh')
-rw-r--r-- | git-rebase--merge.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh index e7d96de9ad..838fbed6c9 100644 --- a/git-rebase--merge.sh +++ b/git-rebase--merge.sh @@ -101,6 +101,17 @@ finish_rb_merge () { say All done. } +# The whole contents of this file is run by dot-sourcing it from +# inside a shell function. It used to be that "return"s we see +# below were not inside any function, and expected to return +# to the function that dot-sourced us. +# +# However, FreeBSD /bin/sh misbehaves on such a construct and +# continues to run the statements that follow such a "return". +# As a work-around, we introduce an extra layer of a function +# here, and immediately call it after defining it. +git_rebase__merge () { + case "$action" in continue) read_state @@ -151,3 +162,7 @@ do done finish_rb_merge + +} +# ... and then we call the whole thing. +git_rebase__merge |