X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fshortlog.c;h=2135b0dde11faa0c501682ed074e0ba96bf28b42;hb=ae0a37cd6bc05b5ab511d0d1a541dc57d52753e6;hp=5089502800d5f477f47b6cd6499d278097f11e67;hpb=e1ba0f6340c1d72677c7792a0a82ecf05363026e;p=git.git diff --git a/builtin/shortlog.c b/builtin/shortlog.c index 508950280..2135b0dde 100644 --- a/builtin/shortlog.c +++ b/builtin/shortlog.c @@ -84,7 +84,7 @@ static void insert_one_record(struct shortlog *log, snprintf(namebuf + len, room, " <%.*s>", maillen, emailbuf); } - item = string_list_insert(namebuf, &log->list); + item = string_list_insert(&log->list, namebuf); if (item->util == NULL) item->util = xcalloc(1, sizeof(struct string_list)); @@ -115,7 +115,7 @@ static void insert_one_record(struct shortlog *log, } } - string_list_append(buffer, item->util); + string_list_append(item->util, buffer); } static void read_from_stdin(struct shortlog *log) @@ -249,7 +249,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) { static struct shortlog log; static struct rev_info rev; - int nongit; + int nongit = !startup_info->have_repository; static const struct option options[] = { OPT_BOOLEAN('n', "numbered", &log.sort_by_number, @@ -265,7 +265,6 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) struct parse_opt_ctx_t ctx; - prefix = setup_git_directory_gently(&nongit); git_config(git_default_config, NULL); shortlog_init(&log); init_revisions(&rev, prefix);