Re: [PATCH v4 29/39] http-fetch: set up git directory before parsing pack hashes
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jul 26, 2020, 23:30 UTC
- Message-ID
- <CAPig+cTSxGC8ipo_NAByuiSzsV2kJAa_R1W34g2PP0+ZacH6Dw@mail.gmail.com>
- In-Reply-To
- <CAPig+cR4G5czLgAo=H-+HXOye+qCLmtUcE9-DKoh=+yptMitPw@mail.gmail.com>
On Sun, Jul 26, 2020 at 7:28 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 8 quoted lines
> This change has the unfortunate side-effect that "git http-fetch -h" > will no longer work if setup_git_directory() fails, which could easily > be the case if the user is trying to get help for the command from > some arbitrary location in the filesystem. > > It might be better to setup_git_directory() on-demand when it's needed > by --packfile= rather than doing it unconditionally before the > argument-parsing loop.
Better yet, use setup_git_directory_gently() before entering the argument-parsing loop.