Code

Merge branch 'jc/merge-sans-branch'
[git.git] / builtin / reset.c
index 0823955d2261c2f9810a80f46143f4ca3c1c868a..98bca044c1267fa63cb084a45aaf621e85f7d9b6 100644 (file)
@@ -7,7 +7,7 @@
  *
  * Copyright (c) 2005, 2006 Linus Torvalds and Junio C Hamano
  */
-#include "cache.h"
+#include "builtin.h"
 #include "tag.h"
 #include "object.h"
 #include "commit.h"
@@ -30,7 +30,7 @@ static const char * const git_reset_usage[] = {
 
 enum reset_type { MIXED, SOFT, HARD, MERGE, KEEP, NONE };
 static const char *reset_type_names[] = {
-       "mixed", "soft", "hard", "merge", "keep", NULL
+       N_("mixed"), N_("soft"), N_("hard"), N_("merge"), N_("keep"), NULL
 };
 
 static char *args_to_str(const char **argv)
@@ -142,7 +142,7 @@ static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
                return error(_("Could not read index"));
 
        result = refresh_index(&the_index, (flags), NULL, NULL,
-                              "Unstaged changes after reset:") ? 1 : 0;
+                              _("Unstaged changes after reset:")) ? 1 : 0;
        if (write_cache(fd, active_cache, active_nr) ||
                        commit_locked_index(index_lock))
                return error ("Could not refresh index");
@@ -228,8 +228,8 @@ static void prepend_reflog_action(const char *action, char *buf, size_t size)
 static void die_if_unmerged_cache(int reset_type)
 {
        if (is_merge() || read_cache() < 0 || unmerged_cache())
-               die("Cannot do a %s reset in the middle of a merge.",
-                   reset_type_names[reset_type]);
+               die(_("Cannot do a %s reset in the middle of a merge."),
+                   _(reset_type_names[reset_type]));
 
 }
 
@@ -320,8 +320,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                if (reset_type == MIXED)
                        warning(_("--mixed with paths is deprecated; use 'git reset -- <paths>' instead."));
                else if (reset_type != NONE)
-                       die("Cannot do %s reset with paths.",
-                                       reset_type_names[reset_type]);
+                       die(_("Cannot do %s reset with paths."),
+                                       _(reset_type_names[reset_type]));
                return read_from_tree(prefix, argv + i, sha1,
                                quiet ? REFRESH_QUIET : REFRESH_IN_PORCELAIN);
        }
@@ -332,8 +332,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                setup_work_tree();
 
        if (reset_type == MIXED && is_bare_repository())
-               die("%s reset is not allowed in a bare repository",
-                   reset_type_names[reset_type]);
+               die(_("%s reset is not allowed in a bare repository"),
+                   _(reset_type_names[reset_type]));
 
        /* Soft reset does not touch the index file nor the working tree
         * at all, but requires them in a good order.  Other resets reset