]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-rebase--interactive.sh
fix portability issues with $ in double quotes
[git.git] / git-rebase--interactive.sh
index e551906ecd2a72fa56fa6ef5dba8f12708acb337..19a608c27fa84d4034bfa6e9d8d001f8819983cf 100755 (executable)
@@ -215,10 +215,10 @@ has_action () {
 # Run command with GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL, and
 # GIT_AUTHOR_DATE exported from the current environment.
 do_with_author () {
-       GIT_AUTHOR_NAME="$GIT_AUTHOR_NAME" \
-       GIT_AUTHOR_EMAIL="$GIT_AUTHOR_EMAIL" \
-       GIT_AUTHOR_DATE="$GIT_AUTHOR_DATE" \
-       "$@"
+       (
+               export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
+               "$@"
+       )
 }
 
 pick_one () {
@@ -235,7 +235,7 @@ pick_one () {
        parent_sha1=$(git rev-parse --verify $sha1^) ||
                die "Could not get the parent of $sha1"
        current_sha1=$(git rev-parse --verify HEAD)
-       if test -z "$no_ff" -a "$current_sha1" = "$parent_sha1"
+       if test -z "$no_ff" && test "$current_sha1" = "$parent_sha1"
        then
                output git reset --hard $sha1
                output warn Fast-forward to $(git rev-parse --short $sha1)
@@ -407,7 +407,7 @@ update_squash_messages () {
 }
 
 peek_next_command () {
-       sed -n -e "/^#/d" -e "/^$/d" -e "s/ .*//p" -e "q" < "$TODO"
+       sed -n -e "/^#/d" -e '/^$/d' -e "s/ .*//p" -e "q" < "$TODO"
 }
 
 # A squash/fixup has failed.  Prepare the long version of the squash