Code

Merge branch 'mg/merge-ff-config'
[git.git] / builtin / merge.c
index 65c79630f0ee2a36d0caccb8e12f7f38993dfc79..7eebb71491047b2df6231df500e5fc28db1881b4 100644 (file)
@@ -840,7 +840,7 @@ static void read_merge_msg(void)
 {
        strbuf_reset(&merge_msg);
        if (strbuf_read_file(&merge_msg, git_path("MERGE_MSG"), 0) < 0)
-               die_errno("Could not read from '%s'", git_path("MERGE_MSG"));
+               die_errno(_("Could not read from '%s'"), git_path("MERGE_MSG"));
 }
 
 static void run_prepare_commit_msg(void)
@@ -980,16 +980,16 @@ static int setup_with_upstream(const char ***argv)
        const char **args;
 
        if (!branch)
-               die("No current branch.");
+               die(_("No current branch."));
        if (!branch->remote)
-               die("No remote for the current branch.");
+               die(_("No remote for the current branch."));
        if (!branch->merge_nr)
-               die("No default upstream defined for the current branch.");
+               die(_("No default upstream defined for the current branch."));
 
        args = xcalloc(branch->merge_nr + 1, sizeof(char *));
        for (i = 0; i < branch->merge_nr; i++) {
                if (!branch->merge[i]->dst)
-                       die("No remote tracking branch for %s from %s",
+                       die(_("No remote tracking branch for %s from %s"),
                            branch->merge[i]->src, branch->remote_name);
                args[i] = branch->merge[i]->dst;
        }
@@ -1063,10 +1063,10 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
        }
        if (file_exists(git_path("CHERRY_PICK_HEAD"))) {
                if (advice_resolve_conflict)
-                       die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
-                           "Please, commit your changes before you can merge.");
+                       die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
+                           "Please, commit your changes before you can merge."));
                else
-                       die("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).");
+                       die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists)."));
        }
        resolve_undo_clear();
 
@@ -1082,9 +1082,12 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
        if (!allow_fast_forward && fast_forward_only)
                die(_("You cannot combine --no-ff with --ff-only."));
 
-       if (!argc && !abort_current_merge && default_to_upstream)
-               argc = setup_with_upstream(&argv);
-
+       if (!abort_current_merge) {
+               if (!argc && default_to_upstream)
+                       argc = setup_with_upstream(&argv);
+               else if (argc == 1 && !strcmp(argv[0], "-"))
+                       argv[0] = "@{-1}";
+       }
        if (!argc)
                usage_with_options(builtin_merge_usage,
                        builtin_merge_options);