# patch did not touch, so recursive ends up canceling them,
# saying that we reverted all those changes.
- eval GITHEAD_$his_tree='"$SUBJECT"'
+ eval GITHEAD_$his_tree='"$FIRSTLINE"'
export GITHEAD_$his_tree
git-merge-recursive $orig_tree -- HEAD $his_tree || {
git rerere
unset GITHEAD_$his_tree
}
-reread_subject () {
- git stripspace <"$1" | sed -e 1q
-}
-
prec=4
dotest=".dotest"
sign= utf8=t keep= skip= interactive= resolved= binary= rebasing=
echo "Patch is empty. Was it split wrong?"
stop_here $this
}
- git stripspace < "$dotest/msg" > "$dotest/msg-clean"
+ SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
+ case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
+
+ (echo "$SUBJECT" ; echo ; cat "$dotest/msg") |
+ git stripspace > "$dotest/msg-clean"
;;
esac
export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
- SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
- case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
-
case "$resume" in
'')
if test '' != "$SIGNOFF"
ADD_SIGNOFF=
fi
{
- printf '%s\n' "$SUBJECT"
if test -s "$dotest/msg-clean"
then
- echo
cat "$dotest/msg-clean"
fi
if test '' != "$ADD_SIGNOFF"
;;
esac
esac
+ FIRSTLINE=$(head -1 "$dotest/final-commit")
resume=
if test "$interactive" = t
[aA]*) action=yes interactive= ;;
[nN]*) action=skip ;;
[eE]*) git_editor "$dotest/final-commit"
- SUBJECT=$(reread_subject "$dotest/final-commit")
+ FIRSTLINE=$(head -1 "$dotest/final-commit")
action=again ;;
[vV]*) action=again
LESS=-S ${PAGER:-less} "$dotest/patch" ;;
stop_here $this
fi
- printf 'Applying %s\n' "$SUBJECT"
+ printf 'Applying %s\n' "$FIRSTLINE"
case "$resolved" in
'')
tree=$(git write-tree) &&
parent=$(git rev-parse --verify HEAD) &&
commit=$(git commit-tree $tree -p $parent <"$dotest/final-commit") &&
- git update-ref -m "$GIT_REFLOG_ACTION: $SUBJECT" HEAD $commit $parent ||
+ git update-ref -m "$GIT_REFLOG_ACTION: $FIRSTLINE" HEAD $commit $parent ||
stop_here $this
if test -x "$GIT_DIR"/hooks/post-applypatch