summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-05-10 10:49:52 -0700
committerJunio C Hamano <gitster@pobox.com>2012-05-10 10:49:52 -0700
commit989f869b2c7886ce434e8f8bf4499147376cbf5d (patch)
tree840c23538066587c81c2fc4fd78b686a58a61092 /builtin
parentf7858ad1e1686ff65cc77989c49f13352934adbc (diff)
parent4c5197d10f01f1dce817af05fd0837bce84708b7 (diff)
downloadgit-989f869b2c7886ce434e8f8bf4499147376cbf5d.tar.gz
Merge branch 'nd/i18n-apply-lego'
By Nguyễn Thái Ngọc Duy * nd/i18n-apply-lego: apply: remove lego in i18n string in gitdiff_verify_name
Diffstat (limited to 'builtin')
-rw-r--r--builtin/apply.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/builtin/apply.c b/builtin/apply.c
index 725712d788..1793c33ee9 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -919,7 +919,10 @@ static int gitdiff_hdrend(const char *line, struct patch *patch)
* their names against any previous information, just
* to make sure..
*/
-static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name, const char *oldnew)
+#define DIFF_OLD_NAME 0
+#define DIFF_NEW_NAME 1
+
+static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name, int side)
{
if (!orig_name && !isnull)
return find_name(line, NULL, p_value, TERM_TAB);
@@ -934,7 +937,9 @@ static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name,
die(_("git apply: bad git-diff - expected /dev/null, got %s on line %d"), name, linenr);
another = find_name(line, NULL, p_value, TERM_TAB);
if (!another || memcmp(another, name, len + 1))
- die(_("git apply: bad git-diff - inconsistent %s filename on line %d"), oldnew, linenr);
+ die((side == DIFF_NEW_NAME) ?
+ _("git apply: bad git-diff - inconsistent new filename on line %d") :
+ _("git apply: bad git-diff - inconsistent old filename on line %d"), linenr);
free(another);
return orig_name;
}
@@ -949,7 +954,8 @@ static char *gitdiff_verify_name(const char *line, int isnull, char *orig_name,
static int gitdiff_oldname(const char *line, struct patch *patch)
{
char *orig = patch->old_name;
- patch->old_name = gitdiff_verify_name(line, patch->is_new, patch->old_name, "old");
+ patch->old_name = gitdiff_verify_name(line, patch->is_new, patch->old_name,
+ DIFF_OLD_NAME);
if (orig != patch->old_name)
free(orig);
return 0;
@@ -958,7 +964,8 @@ static int gitdiff_oldname(const char *line, struct patch *patch)
static int gitdiff_newname(const char *line, struct patch *patch)
{
char *orig = patch->new_name;
- patch->new_name = gitdiff_verify_name(line, patch->is_delete, patch->new_name, "new");
+ patch->new_name = gitdiff_verify_name(line, patch->is_delete, patch->new_name,
+ DIFF_NEW_NAME);
if (orig != patch->new_name)
free(orig);
return 0;