Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-11-28 02:06:37 +0300
committerJunio C Hamano <gitster@pobox.com>2009-11-28 02:11:47 +0300
commitc970a6fd0142da3740f0205f16f91d3f2ed7e258 (patch)
tree8003818a9ccc50dbcb1f6a8f5b3dddca571a8d27 /git-am.sh
parent82d97da30aba767e5c8406b595274af299858357 (diff)
Remove dead code from "git am"
Ever since the initial implementation, "git am" had kept a dead code that never triggered due to a typo in the variable name. Worse yet, the code, if it weren't for the typo, would have attempted to add "[PATCH] " at the beginning of the Subject: header when "git am" is run with its "-k" option. However, because "git am -k" tells mailinfo to keep such prefix when parsing the input, the "[PATCH] " added by this dead code would have really been unnecessary duplicate. Embarrassing is that we kept _maintaining_ the codepath without anybody noticing for four years. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-am.sh b/git-am.sh
index aa602618e6..9050cc9076 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -350,11 +350,12 @@ do
git cat-file commit "$commit" |
sed -e '1,/^$/d' >"$dotest/msg-clean"
else
- SUBJECT="$(sed -n '/^Subject/ s/Subject: //p' "$dotest/info")"
- case "$keep_subject" in -k) SUBJECT="[PATCH] $SUBJECT" ;; esac
-
- (printf '%s\n\n' "$SUBJECT"; cat "$dotest/msg") |
- git stripspace > "$dotest/msg-clean"
+ {
+ sed -n '/^Subject/ s/Subject: //p' "$dotest/info"
+ echo
+ cat "$dotest/msg"
+ } |
+ git stripspace > "$dotest/msg-clean"
fi
;;
esac