@matheusbsbs / matheus-bagliano / commits / e84d7b74c6
Fork 0

i18n: git-clone basic messages

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Feb 22, 2011 at 23:41 UTC e84d7b74c6e59fac20209c4759791f39afc0e25b
1 file changed +27 -27
builtin/clone.c
+27 -27
@@ -208,7 +208,7 @@ static void setup_reference(const char *repo)
208 if (is_directory(mkpath("%s/.git/objects", ref_git)))
209 ref_git = mkpath("%s/.git", ref_git);
210 else if (!is_directory(mkpath("%s/objects", ref_git)))
211 - die("reference repository '%s' is not a local directory.",
211 + die(_("reference repository '%s' is not a local directory."),
212 option_reference);
213
214 ref_git_copy = xstrdup(ref_git);
@@ -235,15 +235,15 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
235
236 dir = opendir(src->buf);
237 if (!dir)
238 - die_errno("failed to open '%s'", src->buf);
238 + die_errno(_("failed to open '%s'"), src->buf);
239
240 if (mkdir(dest->buf, 0777)) {
241 if (errno != EEXIST)
242 - die_errno("failed to create directory '%s'", dest->buf);
242 + die_errno(_("failed to create directory '%s'"), dest->buf);
243 else if (stat(dest->buf, &buf))
244 - die_errno("failed to stat '%s'", dest->buf);
244 + die_errno(_("failed to stat '%s'"), dest->buf);
245 else if (!S_ISDIR(buf.st_mode))
246 - die("%s exists and is not a directory", dest->buf);
246 + die(_("%s exists and is not a directory"), dest->buf);
247 }
248
249 strbuf_addch(src, '/');
@@ -257,7 +257,7 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
257 strbuf_setlen(dest, dest_len);
258 strbuf_addstr(dest, de->d_name);
259 if (stat(src->buf, &buf)) {
260 - warning ("failed to stat %s\n", src->buf);
260 + warning (_("failed to stat %s\n"), src->buf);
261 continue;
262 }
263 if (S_ISDIR(buf.st_mode)) {
@@ -267,16 +267,16 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest)
267 }
268
269 if (unlink(dest->buf) && errno != ENOENT)
270 - die_errno("failed to unlink '%s'", dest->buf);
270 + die_errno(_("failed to unlink '%s'"), dest->buf);
271 if (!option_no_hardlinks) {
272 if (!link(src->buf, dest->buf))
273 continue;
274 if (option_local)
275 - die_errno("failed to create link '%s'", dest->buf);
275 + die_errno(_("failed to create link '%s'"), dest->buf);
276 option_no_hardlinks = 1;
277 }
278 if (copy_file_with_time(dest->buf, src->buf, 0666))
279 - die_errno("failed to copy file to '%s'", dest->buf);
279 + die_errno(_("failed to copy file to '%s'"), dest->buf);
280 }
281 closedir(dir);
282 }
@@ -305,7 +305,7 @@ static const struct ref *clone_local(const char *src_repo,
305 ret = transport_get_remote_refs(transport);
306 transport_disconnect(transport);
307 if (0 <= option_verbosity)
308 - printf("done.\n");
308 + printf(_("done.\n"));
309 return ret;
310 }
311
@@ -387,11 +387,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
387 builtin_clone_usage, 0);
388
389 if (argc > 2)
390 - usage_msg_opt("Too many arguments.",
390 + usage_msg_opt(_("Too many arguments."),
391 builtin_clone_usage, builtin_clone_options);
392
393 if (argc == 0)
394 - usage_msg_opt("You must specify a repository to clone.",
394 + usage_msg_opt(_("You must specify a repository to clone."),
395 builtin_clone_usage, builtin_clone_options);
396
397 if (option_mirror)
@@ -399,7 +399,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
399
400 if (option_bare) {
401 if (option_origin)
402 - die("--bare and --origin %s options are incompatible.",
402 + die(_("--bare and --origin %s options are incompatible."),
403 option_origin);
404 option_no_checkout = 1;
405 }
@@ -418,7 +418,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
418 repo = repo_name;
419 is_local = path && !is_bundle;
420 if (is_local && option_depth)
421 - warning("--depth is ignored in local clones; use file:// instead.");
421 + warning(_("--depth is ignored in local clones; use file:// instead."));
422
423 if (argc == 2)
424 dir = xstrdup(argv[1]);
@@ -428,8 +428,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
428
429 dest_exists = !stat(dir, &buf);
430 if (dest_exists && !is_empty_dir(dir))
431 - die("destination path '%s' already exists and is not "
432 - "an empty directory.", dir);
431 + die(_("destination path '%s' already exists and is not "
432 + "an empty directory."), dir);
433
434 strbuf_addf(&reflog_msg, "clone: from %s", repo);
435
@@ -438,7 +438,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
438 else {
439 work_tree = getenv("GIT_WORK_TREE");
440 if (work_tree && !stat(work_tree, &buf))
441 - die("working tree '%s' already exists.", work_tree);
441 + die(_("working tree '%s' already exists."), work_tree);
442 }
443
444 if (option_bare || work_tree)
@@ -451,10 +451,10 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
451 if (!option_bare) {
452 junk_work_tree = work_tree;
453 if (safe_create_leading_directories_const(work_tree) < 0)
454 - die_errno("could not create leading directories of '%s'",
454 + die_errno(_("could not create leading directories of '%s'"),
455 work_tree);
456 if (!dest_exists && mkdir(work_tree, 0755))
457 - die_errno("could not create work tree dir '%s'.",
457 + die_errno(_("could not create work tree dir '%s'."),
458 work_tree);
459 set_git_work_tree(work_tree);
460 }
@@ -465,7 +465,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
465 setenv(CONFIG_ENVIRONMENT, mkpath("%s/config", git_dir), 1);
466
467 if (safe_create_leading_directories_const(git_dir) < 0)
468 - die("could not create leading directories of '%s'", git_dir);
468 + die(_("could not create leading directories of '%s'"), git_dir);
469 set_git_dir(make_absolute_path(git_dir));
470
471 if (0 <= option_verbosity)
@@ -527,7 +527,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
527 transport = transport_get(remote, remote->url[0]);
528
529 if (!transport->get_refs_list || !transport->fetch)
530 - die("Don't know how to clone %s", transport->url);
530 + die(_("Don't know how to clone %s"), transport->url);
531
532 transport_set_option(transport, TRANS_OPT_KEEP, "yes");
533
@@ -566,8 +566,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
566 strbuf_release(&head);
567
568 if (!our_head_points_at) {
569 - warning("Remote branch %s not found in "
570 - "upstream %s, using HEAD instead",
569 + warning(_("Remote branch %s not found in "
570 + "upstream %s, using HEAD instead"),
571 option_branch, option_origin);
572 our_head_points_at = remote_head_points_at;
573 }
@@ -576,7 +576,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
576 our_head_points_at = remote_head_points_at;
577 }
578 else {
579 - warning("You appear to have cloned an empty repository.");
579 + warning(_("You appear to have cloned an empty repository."));
580 our_head_points_at = NULL;
581 remote_head_points_at = NULL;
582 remote_head = NULL;
@@ -618,8 +618,8 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
618 } else {
619 /* Nothing to checkout out */
620 if (!option_no_checkout)
621 - warning("remote HEAD refers to nonexistent ref, "
622 - "unable to checkout.\n");
621 + warning(_("remote HEAD refers to nonexistent ref, "
622 + "unable to checkout.\n"));
623 option_no_checkout = 1;
624 }
625
@@ -655,7 +655,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
655
656 if (write_cache(fd, active_cache, active_nr) ||
657 commit_locked_index(lock_file))
658 - die("unable to write new index file");
658 + die(_("unable to write new index file"));
659
660 err |= run_hook(NULL, "post-checkout", sha1_to_hex(null_sha1),
661 sha1_to_hex(our_head_points_at->old_sha1), "1",