X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-shortlog.c;h=e6a2865019cceadfcbfc8575a2bd1f97b7159dcb;hb=06f60e8edf1eb3a91e1af6f255bf46154168dd86;hp=b22b0edd65eefacabb648962b9c20c695609a3f5;hpb=ad416ed433fdcf838916a84177fe9e810be19eff;p=git.git diff --git a/builtin-shortlog.c b/builtin-shortlog.c index b22b0edd6..e6a286501 100644 --- a/builtin-shortlog.c +++ b/builtin-shortlog.c @@ -9,7 +9,7 @@ #include "shortlog.h" static const char shortlog_usage[] = -"git-shortlog [-n] [-s] [-e] [... ]"; +"git-shortlog [-n] [-s] [-e] [-w] [... ]"; static int compare_by_number(const void *a1, const void *a2) { @@ -229,7 +229,9 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) { struct shortlog log; struct rev_info rev; + int nongit; + prefix = setup_git_directory_gently(&nongit); shortlog_init(&log); /* since -n is a shadowed rev argument, parse our args first */ @@ -259,7 +261,7 @@ int cmd_shortlog(int argc, const char **argv, const char *prefix) die ("unrecognized argument: %s", argv[1]); /* assume HEAD if from a tty */ - if (!rev.pending.nr && isatty(0)) + if (!nongit && !rev.pending.nr && isatty(0)) add_head_to_pending(&rev); if (rev.pending.nr == 0) { read_from_stdin(&log);