]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-rebase--interactive.sh
config.mak.uname: resolve FreeBSD iconv-related compilation warning
[thirdparty/git.git] / git-rebase--interactive.sh
index cbf44f864828cca964693bea6a701ce882afd6eb..06a7b793075d7701b5dafa69b3576d13ba7c9de6 100644 (file)
@@ -81,6 +81,8 @@ rewritten_pending="$state_dir"/rewritten-pending
 # and leaves CR at the end instead.
 cr=$(printf "\015")
 
+empty_tree=$(git hash-object -t tree /dev/null)
+
 strategy_args=${strategy:+--strategy=$strategy}
 test -n "$strategy_opts" &&
 eval '
@@ -160,7 +162,7 @@ r, reword <commit> = use commit, but edit the commit message
 e, edit <commit> = use commit, but stop for amending
 s, squash <commit> = use commit, but meld into previous commit
 f, fixup <commit> = like \"squash\", but discard this commit's log message
-x, exec <commit> = run command (the rest of the line) using shell
+x, exec <command> = run command (the rest of the line) using shell
 d, drop <commit> = remove commit
 l, label <label> = label current HEAD with a name
 t, reset <label> = reset HEAD to a label
@@ -244,7 +246,7 @@ is_empty_commit() {
                die "$(eval_gettext "\$sha1: not a commit that can be picked")"
        }
        ptree=$(git rev-parse -q --verify "$1"^^{tree} 2>/dev/null) ||
-               ptree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+               ptree=$empty_tree
        test "$tree" = "$ptree"
 }
 
@@ -894,6 +896,8 @@ init_revisions_and_shortrevisions () {
        else
                revisions=$onto...$orig_head
                shortrevisions=$shorthead
+               test -z "$squash_onto" ||
+               echo "$squash_onto" >"$state_dir"/squash-onto
        fi
 }
 
@@ -948,7 +952,7 @@ EOF
        die "Could not skip unnecessary pick commands"
 
        checkout_onto
-       if test -z "$rebase_root" && test ! -d "$rewritten"
+       if test ! -d "$rewritten"
        then
                require_clean_work_tree "rebase"
                exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \