Re: [PATCH 10/11] builtin/shortlog: don't set up revisions without repo
On 24/04/19 11:51AM, Patrick Steinhardt wrote:
Show 6 quoted lines
> It is possible to run git-shortlog(1) outside of a repository by passing
> it output from git-log(1) via standard input. Obviously, as there is no
> repository in that context, it is thus unsupported to pass any revisions
> as arguments.
>
> Reghardless of that we still end up calling `setup_revisions()`. While
s/Reghardless/Regardless/
Show 8 quoted lines
> that works alright, it is somewhat strange. Furthermore, this is about
> to cause problems when we unset the default object hash.
>
> Refactor the code to only call `setup_revisions()` when we have a
> repository. This is safe to do as we already verify that there are no
> arguments when running outside of a repository anyway.
>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>