From: Ramkumar Ramachandra Date: Thu, 4 Aug 2011 10:39:02 +0000 (+0530) Subject: revert: Don't check lone argument in get_encoding X-Git-Tag: v1.7.8-rc0~141^2~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a2ec3ad28f4608bc848feaa3d087632e44842dbf;p=git.git revert: Don't check lone argument in get_encoding The only place get_encoding uses the global "commit" variable is when writing an error message explaining that its lone argument was NULL. Since the function's only caller ensures that a NULL argument isn't passed, we can remove this check with two beneficial consequences: 1. Since the function doesn't use the global "commit" variable any more, it won't need to change when we eliminate the global variable later in the series. 2. Translators no longer need to localize an error message that will never be shown. Suggested-by: Junio C Hamano Mentored-by: Jonathan Nieder Signed-off-by: Ramkumar Ramachandra Signed-off-by: Junio C Hamano --- diff --git a/builtin/revert.c b/builtin/revert.c index 7dfe2951d..30b39c040 100644 --- a/builtin/revert.c +++ b/builtin/revert.c @@ -167,9 +167,6 @@ static char *get_encoding(const char *message) { const char *p = message, *eol; - if (!p) - die (_("Could not read commit message of %s"), - sha1_to_hex(commit->object.sha1)); while (*p && *p != '\n') { for (eol = p + 1; *eol && *eol != '\n'; eol++) ; /* do nothing */