git-tar-tree: no more void pointer arithmetic
[git.git] / git-am.sh
index f50dff2..4232e27 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -15,6 +15,10 @@ stop_here () {
 }
 
 stop_here_user_resolve () {
+    if [ -n "$resolvemsg" ]; then
+           echo "$resolvemsg"
+           stop_here $1
+    fi
     cmdline=$(basename $0)
     if test '' != "$interactive"
     then
@@ -87,7 +91,7 @@ fall_back_3way () {
 }
 
 prec=4
-dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary= ws=
+dotest=.dotest sign= utf8= keep= skip= interactive= resolved= binary= ws= resolvemsg=
 
 while case "$#" in 0) break;; esac
 do
@@ -123,6 +127,9 @@ do
        --whitespace=*)
        ws=$1; shift ;;
 
+       --resolvemsg=*)
+       resolvemsg=$(echo "$1" | sed -e "s/^--resolvemsg=//"); shift ;;
+
        --)
        shift; break ;;
        -*)
@@ -151,7 +158,7 @@ then
 else
        # Make sure we are not given --skip nor --resolved
        test ",$skip,$resolved," = ,,, ||
-               die "we are not resuming."
+               die "Resolve operation not in progress, we are not resuming."
 
        # Start afresh.
        mkdir -p "$dotest" || exit
@@ -406,7 +413,7 @@ do
        parent=$(git-rev-parse --verify HEAD) &&
        commit=$(git-commit-tree $tree -p $parent <"$dotest/final-commit") &&
        echo Committed: $commit &&
-       git-update-ref HEAD $commit $parent ||
+       git-update-ref -m "am: $SUBJECT" HEAD $commit $parent ||
        stop_here $this
 
        if test -x "$GIT_DIR"/hooks/post-applypatch