contrib/examples/git-commit.sh: avoid "test <cond> -a/-o <cond>"
[gitweb.git] / git-rebase.sh
index 2c75e9fa0f8d4c10e6caa2b3f4d018a11bbf0f8f..5c7a0a1a583552de49ee2e094e80f80ee18fd68c 100755 (executable)
@@ -175,22 +175,13 @@ You can run "git stash pop" or "git stash drop" at any time.
        rm -rf "$state_dir"
 }
 
-run_specific_rebase_internal () {
+run_specific_rebase () {
        if [ "$interactive_rebase" = implied ]; then
                GIT_EDITOR=:
                export GIT_EDITOR
                autosquash=
        fi
-       # On FreeBSD, the shell's "return" returns from the current
-       # function, not from the current file inclusion.
-       # run_specific_rebase_internal has the file inclusion as a
-       # last statement, so POSIX and FreeBSD's return will do the
-       # same thing.
        . git-rebase--$type
-}
-
-run_specific_rebase () {
-       run_specific_rebase_internal
        ret=$?
        if test $ret -eq 0
        then
@@ -466,8 +457,8 @@ then
 else
        if test -z "$onto"
        then
-               empty_tree=`git hash-object -t tree /dev/null`
-               onto=`git commit-tree $empty_tree </dev/null`
+               empty_tree=$(git hash-object -t tree /dev/null)
+               onto=$(git commit-tree $empty_tree </dev/null)
                squash_onto="$onto"
        fi
        unset upstream_name
@@ -525,10 +516,10 @@ case "$#" in
        ;;
 0)
        # Do not need to switch branches, we are already on it.
-       if branch_name=`git symbolic-ref -q HEAD`
+       if branch_name=$(git symbolic-ref -q HEAD)
        then
                head_name=$branch_name
-               branch_name=`expr "z$branch_name" : 'zrefs/heads/\(.*\)'`
+               branch_name=$(expr "z$branch_name" : 'zrefs/heads/\(.*\)')
        else
                head_name="detached HEAD"
                branch_name=HEAD ;# detached