Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
i18n: git-add basic messages
author
Ævar Arnfjörð Bjarmason
<avarab@gmail.com>
Tue, 22 Feb 2011 23:41:29 +0000
(23:41 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 10 Mar 2011 07:52:53 +0000
(23:52 -0800)
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>
builtin/add.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
5cde598
)
diff --git
a/builtin/add.c
b/builtin/add.c
index 42c906ea06b3d20d88ed6ba1c83d894d4e24f163..a9a78f4bdab3a2839c768844ba28b403e75cc13d 100644
(file)
--- a/
builtin/add.c
+++ b/
builtin/add.c
@@
-38,7
+38,7
@@
static void update_callback(struct diff_queue_struct *q,
const char *path = p->one->path;
switch (p->status) {
default:
const char *path = p->one->path;
switch (p->status) {
default:
- die(
"unexpected diff status %c"
, p->status);
+ die(
_("unexpected diff status %c")
, p->status);
case DIFF_STATUS_UNMERGED:
/*
* ADD_CACHE_IGNORE_REMOVAL is unset if "git
case DIFF_STATUS_UNMERGED:
/*
* ADD_CACHE_IGNORE_REMOVAL is unset if "git
@@
-64,7
+64,7
@@
static void update_callback(struct diff_queue_struct *q,
case DIFF_STATUS_TYPE_CHANGED:
if (add_file_to_index(&the_index, path, data->flags)) {
if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
case DIFF_STATUS_TYPE_CHANGED:
if (add_file_to_index(&the_index, path, data->flags)) {
if (!(data->flags & ADD_CACHE_IGNORE_ERRORS))
- die(
"updating files failed"
);
+ die(
_("updating files failed")
);
data->add_errors++;
}
break;
data->add_errors++;
}
break;
@@
-172,7
+172,7
@@
static void treat_gitlinks(const char **pathspec)
/* strip trailing slash */
pathspec[j] = xstrndup(ce->name, len);
else
/* strip trailing slash */
pathspec[j] = xstrndup(ce->name, len);
else
- die (
"Path '%s' is in submodule '%.*s'"
,
+ die (
_("Path '%s' is in submodule '%.*s'")
,
pathspec[j], len, ce->name);
}
}
pathspec[j], len, ce->name);
}
}
@@
-191,7
+191,7
@@
static void refresh(int verbose, const char **pathspec)
pathspec, seen, "Unstaged changes after refreshing the index:");
for (i = 0; i < specs; i++) {
if (!seen[i])
pathspec, seen, "Unstaged changes after refreshing the index:");
for (i = 0; i < specs; i++) {
if (!seen[i])
- die(
"pathspec '%s' did not match any files"
, pathspec[i]);
+ die(
_("pathspec '%s' did not match any files")
, pathspec[i]);
}
free(seen);
}
}
free(seen);
}
@@
-205,7
+205,7
@@
static const char **validate_pathspec(int argc, const char **argv, const char *p
for (p = pathspec; *p; p++) {
if (has_symlink_leading_path(*p, strlen(*p))) {
int len = prefix ? strlen(prefix) : 0;
for (p = pathspec; *p; p++) {
if (has_symlink_leading_path(*p, strlen(*p))) {
int len = prefix ? strlen(prefix) : 0;
- die(
"'%s' is beyond a symbolic link"
, *p + len);
+ die(
_("'%s' is beyond a symbolic link")
, *p + len);
}
}
}
}
}
}
@@
-272,7
+272,7
@@
static int edit_patch(int argc, const char **argv, const char *prefix)
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
if (read_cache() < 0)
git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
if (read_cache() < 0)
- die (
"Could not read the index"
);
+ die (
_("Could not read the index")
);
init_revisions(&rev, prefix);
rev.diffopt.context = 7;
init_revisions(&rev, prefix);
rev.diffopt.context = 7;
@@
-281,24
+281,24
@@
static int edit_patch(int argc, const char **argv, const char *prefix)
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
out = open(file, O_CREAT | O_WRONLY, 0644);
if (out < 0)
rev.diffopt.output_format = DIFF_FORMAT_PATCH;
out = open(file, O_CREAT | O_WRONLY, 0644);
if (out < 0)
- die (
"Could not open '%s' for writing."
, file);
+ die (
_("Could not open '%s' for writing.")
, file);
rev.diffopt.file = xfdopen(out, "w");
rev.diffopt.close_file = 1;
if (run_diff_files(&rev, 0))
rev.diffopt.file = xfdopen(out, "w");
rev.diffopt.close_file = 1;
if (run_diff_files(&rev, 0))
- die (
"Could not write patch"
);
+ die (
_("Could not write patch")
);
launch_editor(file, NULL, NULL);
if (stat(file, &st))
launch_editor(file, NULL, NULL);
if (stat(file, &st))
- die_errno(
"Could not stat '%s'"
, file);
+ die_errno(
_("Could not stat '%s'")
, file);
if (!st.st_size)
if (!st.st_size)
- die(
"Empty patch. Aborted."
);
+ die(
_("Empty patch. Aborted.")
);
memset(&child, 0, sizeof(child));
child.git_cmd = 1;
child.argv = apply_argv;
if (run_command(&child))
memset(&child, 0, sizeof(child));
child.git_cmd = 1;
child.argv = apply_argv;
if (run_command(&child))
- die (
"Could not apply '%s'"
, file);
+ die (
_("Could not apply '%s'")
, file);
unlink(file);
return 0;
unlink(file);
return 0;
@@
-354,7
+354,7
@@
static int add_files(struct dir_struct *dir, int flags)
for (i = 0; i < dir->nr; i++)
if (add_file_to_cache(dir->entries[i]->name, flags)) {
if (!ignore_add_errors)
for (i = 0; i < dir->nr; i++)
if (add_file_to_cache(dir->entries[i]->name, flags)) {
if (!ignore_add_errors)
- die(
"adding files failed"
);
+ die(
_("adding files failed")
);
exit_status = 1;
}
return exit_status;
exit_status = 1;
}
return exit_status;
@@
-386,9
+386,9
@@
int cmd_add(int argc, const char **argv, const char *prefix)
argv++;
if (addremove && take_worktree_changes)
argv++;
if (addremove && take_worktree_changes)
- die(
"-A and -u are mutually incompatible"
);
+ die(
_("-A and -u are mutually incompatible")
);
if (!show_only && ignore_missing)
if (!show_only && ignore_missing)
- die(
"Option --ignore-missing can only be used together with --dry-run"
);
+ die(
_("Option --ignore-missing can only be used together with --dry-run")
);
if ((addremove || take_worktree_changes) && !argc) {
static const char *here[2] = { ".", NULL };
argc = 1;
if ((addremove || take_worktree_changes) && !argc) {
static const char *here[2] = { ".", NULL };
argc = 1;
@@
-408,14
+408,14
@@
int cmd_add(int argc, const char **argv, const char *prefix)
? ADD_CACHE_IGNORE_REMOVAL : 0));
if (require_pathspec && argc == 0) {
? ADD_CACHE_IGNORE_REMOVAL : 0));
if (require_pathspec && argc == 0) {
- fprintf(stderr,
"Nothing specified, nothing added.\n"
);
- fprintf(stderr,
"Maybe you wanted to say 'git add .'?\n"
);
+ fprintf(stderr,
_("Nothing specified, nothing added.\n")
);
+ fprintf(stderr,
_("Maybe you wanted to say 'git add .'?\n")
);
return 0;
}
pathspec = validate_pathspec(argc, argv, prefix);
if (read_cache() < 0)
return 0;
}
pathspec = validate_pathspec(argc, argv, prefix);
if (read_cache() < 0)
- die(
"index file corrupt"
);
+ die(
_("index file corrupt")
);
treat_gitlinks(pathspec);
if (add_new_files) {
treat_gitlinks(pathspec);
if (add_new_files) {
@@
-467,7
+467,7
@@
int cmd_add(int argc, const char **argv, const char *prefix)
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
commit_locked_index(&lock_file))
if (active_cache_changed) {
if (write_cache(newfd, active_cache, active_nr) ||
commit_locked_index(&lock_file))
- die(
"Unable to write new index file"
);
+ die(
_("Unable to write new index file")
);
}
return exit_status;
}
return exit_status;