Merge branch 'es/blame-L-twice'
[gitweb.git] / builtin / reset.c
index 6032131a9087281e97d0abc05365b7485004121b..090581564b2a71d8360c1bc112ba39ceaa96825c 100644 (file)
@@ -93,10 +93,12 @@ static int reset_index(const unsigned char *sha1, int reset_type, int quiet)
 static void print_new_head_line(struct commit *commit)
 {
        const char *hex, *body;
+       char *msg;
 
        hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
        printf(_("HEAD is now at %s"), hex);
-       body = strstr(commit->buffer, "\n\n");
+       msg = logmsg_reencode(commit, NULL, get_log_output_encoding());
+       body = strstr(msg, "\n\n");
        if (body) {
                const char *eol;
                size_t len;
@@ -107,6 +109,7 @@ static void print_new_head_line(struct commit *commit)
        }
        else
                printf("\n");
+       logmsg_free(msg, commit);
 }
 
 static void update_index_from_diff(struct diff_queue_struct *q,
@@ -255,7 +258,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                                N_("reset HEAD, index and working tree"), MERGE),
                OPT_SET_INT(0, "keep", &reset_type,
                                N_("reset HEAD but keep local changes"), KEEP),
-               OPT_BOOLEAN('p', "patch", &patch_mode, N_("select hunks interactively")),
+               OPT_BOOL('p', "patch", &patch_mode, N_("select hunks interactively")),
                OPT_END()
        };