i18n: git-add basic messages
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:41 UTC
990ac4be0ad68e78c042d4caa532c410991420f5
1 file changed
+18
-18
builtin/add.c
+18
-18
@@ -38,7 +38,7 @@ static void update_callback(struct diff_queue_struct *q,
38
const char *path = p->one->path;
39
switch (p->status) {
40
default:
41
- die("unexpected diff status %c", p->status);
41
+ die(_("unexpected diff status %c"), p->status);
42
case DIFF_STATUS_UNMERGED:
43
/*
44
* ADD_CACHE_IGNORE_REMOVAL is unset if "git
@@ -64,7 +64,7 @@ static void update_callback(struct diff_queue_struct *q,
64
case DIFF_STATUS_TYPE_CHANGED:
65
if (add_file_to_index(&the_index, path, data->flags)) {
66
if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
67
- die("updating files failed");
67
+ die(_("updating files failed"));
68
data->add_errors++;
69
}
70
break;
@@ -172,7 +172,7 @@ static void treat_gitlinks(const char **pathspec)
172
/* strip trailing slash */
173
pathspec[j] = xstrndup(ce->name, len);
174
else
175
- die ("Path '%s' is in submodule '%.*s'",
175
+ die (_("Path '%s' is in submodule '%.*s'"),
176
pathspec[j], len, ce->name);
177
}
178
}
@@ -191,7 +191,7 @@ static void refresh(int verbose, const char **pathspec)
191
pathspec, seen, "Unstaged changes after refreshing the index:");
192
for (i = 0; i < specs; i++) {
193
if (!seen[i])
194
- die("pathspec '%s' did not match any files", pathspec[i]);
194
+ die(_("pathspec '%s' did not match any files"), pathspec[i]);
195
}
196
free(seen);
197
}
@@ -205,7 +205,7 @@ static const char **validate_pathspec(int argc, const char **argv, const char *p
205
for (p = pathspec; *p; p++) {
206
if (has_symlink_leading_path(*p, strlen(*p))) {
207
int len = prefix ? strlen(prefix) : 0;
208
- die("'%s' is beyond a symbolic link", *p + len);
208
+ die(_("'%s' is beyond a symbolic link"), *p + len);
209
}
210
}
211
}
@@ -272,7 +272,7 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
272
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
273
274
if (read_cache() < 0)
275
- die ("Could not read the index");
275
+ die (_("Could not read the index"));
276
277
init_revisions(&rev, prefix);
278
rev.diffopt.context = 7;
@@ -281,24 +281,24 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
281
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
282
out = open(file, O_CREAT | O_WRONLY, 0644);
283
if (out < 0)
284
- die ("Could not open '%s' for writing.", file);
284
+ die (_("Could not open '%s' for writing."), file);
285
rev.diffopt.file = xfdopen(out, "w");
286
rev.diffopt.close_file = 1;
287
if (run_diff_files(&rev, 0))
288
- die ("Could not write patch");
288
+ die (_("Could not write patch"));
289
290
launch_editor(file, NULL, NULL);
291
292
if (stat(file, &st))
293
- die_errno("Could not stat '%s'", file);
293
+ die_errno(_("Could not stat '%s'"), file);
294
if (!st.st_size)
295
- die("Empty patch. Aborted.");
295
+ die(_("Empty patch. Aborted."));
296
297
memset(&child, 0, sizeof(child));
298
child.git_cmd = 1;
299
child.argv = apply_argv;
300
if (run_command(&child))
301
- die ("Could not apply '%s'", file);
301
+ die (_("Could not apply '%s'"), file);
302
303
unlink(file);
304
return 0;
@@ -354,7 +354,7 @@ static int add_files(struct dir_struct *dir, int flags)
354
for (i = 0; i < dir->nr; i++)
355
if (add_file_to_cache(dir->entries[i]->name, flags)) {
356
if (!ignore_add_errors)
357
- die("adding files failed");
357
+ die(_("adding files failed"));
358
exit_status = 1;
359
}
360
return exit_status;
@@ -386,9 +386,9 @@ int cmd_add(int argc, const char **argv, const char *prefix)
386
argv++;
387
388
if (addremove && take_worktree_changes)
389
- die("-A and -u are mutually incompatible");
389
+ die(_("-A and -u are mutually incompatible"));
390
if (!show_only && ignore_missing)
391
- die("Option --ignore-missing can only be used together with --dry-run");
391
+ die(_("Option --ignore-missing can only be used together with --dry-run"));
392
if ((addremove || take_worktree_changes) && !argc) {
393
static const char *here[2] = { ".", NULL };
394
argc = 1;
@@ -408,14 +408,14 @@ int cmd_add(int argc, const char **argv, const char *prefix)
408
? ADD_CACHE_IGNORE_REMOVAL : 0));
409
410
if (require_pathspec && argc == 0) {
411
- fprintf(stderr, "Nothing specified, nothing added.\n");
412
- fprintf(stderr, "Maybe you wanted to say 'git add .'?\n");
411
+ fprintf(stderr, _("Nothing specified, nothing added.\n"));
412
+ fprintf(stderr, _("Maybe you wanted to say 'git add .'?\n"));
413
return 0;
414
}
415
pathspec = validate_pathspec(argc, argv, prefix);
416
417
if (read_cache() < 0)
418
- die("index file corrupt");
418
+ die(_("index file corrupt"));
419
treat_gitlinks(pathspec);
420
421
if (add_new_files) {
@@ -467,7 +467,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
467
if (active_cache_changed) {
468
if (write_cache(newfd, active_cache, active_nr) ||
469
commit_locked_index(&lock_file))
470
- die("Unable to write new index file");
470
+ die(_("Unable to write new index file"));
471
}
472
473
return exit_status;