submodule helper: support super prefix
[gitweb.git] / sequencer.c
index 4c10c9355be12a5b0045f322a556035157f9989e..30b10ba143959bf2618872427f730a9f0e30d369 100644 (file)
@@ -248,7 +248,7 @@ static int write_message(const void *buf, size_t len, const char *filename,
        }
        if (append_eol && write(msg_fd, "\n", 1) < 0) {
                rollback_lock_file(&msg_file);
-               return error_errno(_("could not write eol to '%s"), filename);
+               return error_errno(_("could not write eol to '%s'"), filename);
        }
        if (commit_lock_file(&msg_file) < 0) {
                rollback_lock_file(&msg_file);
@@ -479,6 +479,20 @@ static char **read_author_script(void)
        return env;
 }
 
+static const char staged_changes_advice[] =
+N_("you have staged changes in your working tree\n"
+"If these changes are meant to be squashed into the previous commit, run:\n"
+"\n"
+"  git commit --amend %s\n"
+"\n"
+"If they are meant to go into a new commit, run:\n"
+"\n"
+"  git commit %s\n"
+"\n"
+"In both cases, once you're done, continue with:\n"
+"\n"
+"  git rebase --continue\n");
+
 /*
  * If we are cherry-pick, and if the merge did not result in
  * hand-editing, we will hit this commit and inherit the original
@@ -505,16 +519,8 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,
                if (!env) {
                        const char *gpg_opt = gpg_sign_opt_quoted(opts);
 
-                       return error("you have staged changes in your working "
-                               "tree. If these changes are meant to be\n"
-                               "squashed into the previous commit, run:\n\n"
-                               "  git commit --amend %s\n\n"
-                               "If they are meant to go into a new commit, "
-                               "run:\n\n"
-                               "  git commit %s\n\n"
-                               "In both cases, once you're done, continue "
-                               "with:\n\n"
-                               "  git rebase --continue\n", gpg_opt, gpg_opt);
+                       return error(_(staged_changes_advice),
+                                    gpg_opt, gpg_opt);
                }
        }
 
@@ -623,7 +629,7 @@ static const char *todo_command_strings[] = {
 
 static const char *command_to_string(const enum todo_command command)
 {
-       if (command < ARRAY_SIZE(todo_command_strings))
+       if ((size_t)command < ARRAY_SIZE(todo_command_strings))
                return todo_command_strings[command];
        die("Unknown command: %d", command);
 }
@@ -652,7 +658,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
                unborn = get_sha1("HEAD", head);
                if (unborn)
                        hashcpy(head, EMPTY_TREE_SHA1_BIN);
-               if (index_differs_from(unborn ? EMPTY_TREE_SHA1_HEX : "HEAD", 0))
+               if (index_differs_from(unborn ? EMPTY_TREE_SHA1_HEX : "HEAD", 0, 0))
                        return error_dirty_index(opts);
        }
        discard_cache();
@@ -1306,7 +1312,7 @@ int sequencer_continue(struct replay_opts *opts)
                if (res)
                        goto release_todo_list;
        }
-       if (index_differs_from("HEAD", 0)) {
+       if (index_differs_from("HEAD", 0, 0)) {
                res = error_dirty_index(opts);
                goto release_todo_list;
        }