diff options
author | Cedric Schieli <cschieli@gmail.com> | 2010-06-01 12:37:47 +0000 |
---|---|---|
committer | Cedric Schieli <cschieli@gmail.com> | 2010-06-01 12:37:47 +0000 |
commit | 10b8b99e48384b4470cac1330080c12d2ade01de (patch) | |
tree | 7bb4ad6cd94a2c9a960fd9a4532d123eee5151d5 /main/git/git-do-not-dump-core-when-iconv-fails.patch | |
parent | 9252f1cfd78299b137400ed8169a79f7f833daac (diff) | |
parent | c6c0b6f9dbde1244e7b31f74c703178a867e873f (diff) | |
download | aports-10b8b99e48384b4470cac1330080c12d2ade01de.tar.bz2 aports-10b8b99e48384b4470cac1330080c12d2ade01de.tar.xz |
Merge remote branch 'upstream/master' into to-upstreamto-upstream
Diffstat (limited to 'main/git/git-do-not-dump-core-when-iconv-fails.patch')
-rw-r--r-- | main/git/git-do-not-dump-core-when-iconv-fails.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/main/git/git-do-not-dump-core-when-iconv-fails.patch b/main/git/git-do-not-dump-core-when-iconv-fails.patch new file mode 100644 index 00000000..b338ee48 --- /dev/null +++ b/main/git/git-do-not-dump-core-when-iconv-fails.patch @@ -0,0 +1,43 @@ +commit 43acff34b902c38808ac0f326090f2516250e1f0 +Author: Jonathan Nieder <jrnieder@gmail.com> +Date: Sat May 8 18:17:29 2010 -0500 + + cherry-pick: do not dump core when iconv fails + + When cherry-picking, usually the new and old commit encodings are both + UTF-8. Most old iconv implementations do not support this trivial + conversion, so on old platforms, out->message remains NULL, and later + attempts to read it segfault. + + Fix this by noticing the input and output encodings match and skipping + the iconv step, like the other reencode_string() call sites already do. + Also stop segfaulting on other iconv failures: if iconv fails for some + other reason, the best we can do is to pass the old message through. + + This fixes a regression introduced in v1.7.1-rc0~15^2~2 (revert: + clarify label on conflict hunks, 2010-03-20). + + Reported-by: Andreas Krey <a.krey@gmx.de> + Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> + Signed-off-by: Junio C Hamano <gitster@pobox.com> + +diff --git a/builtin/revert.c b/builtin/revert.c +index 778a56e..7d68ef7 100644 +--- a/builtin/revert.c ++++ b/builtin/revert.c +@@ -109,8 +109,13 @@ static int get_message(const char *raw_message, struct commit_message *out) + encoding = "UTF-8"; + if (!git_commit_encoding) + git_commit_encoding = "UTF-8"; +- if ((out->reencoded_message = reencode_string(raw_message, +- git_commit_encoding, encoding))) ++ ++ out->reencoded_message = NULL; ++ out->message = raw_message; ++ if (strcmp(encoding, git_commit_encoding)) ++ out->reencoded_message = reencode_string(raw_message, ++ git_commit_encoding, encoding); ++ if (out->reencoded_message) + out->message = out->reencoded_message; + + abbrev = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV); |