Re: [PATCH 04/14] connect_work_tree_and_git_dir: safely create leading directories
- From
Stefan Beller <sbeller@google.com>
- Date
- Feb 15, 2017, 22:52 UTC
- Message-ID
- <CAGZ79kaX1URNvzp8QuFEFnJDzSW9nE971+nvhPLOQQx4aSyBkA@mail.gmail.com>
- In-Reply-To
- <xmqqh93v48mv.fsf@gitster.mtv.corp.google.com>
On Wed, Feb 15, 2017 at 10:22 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 18 quoted lines
> Stefan Beller <sbeller@google.com> writes: > >> In a later patch we'll use connect_work_tree_and_git_dir when the >> directory for the gitlink file doesn't exist yet. Safely create >> the directory first. >> >> Signed-off-by: Stefan Beller <sbeller@google.com> > > Among the existing two callers, the "absorb" logic in submodule.c > has safe-create-leading-directory (SCLD) immediately before the call > to this function, which can now be lost with this change. The other > one in cmd_mv() has the target directory as the result of moving the > original directory, and I do not think there is any corresponding > call that can be lost from there after this change, but it is not an > error to call SCLD on a path that already exists, so all is OK. > > Is it sensible to let the code continue with just an fprintf() (not > even warning() or error()) when SCLD fails?
I'll move the code from the absorbing here (i.e. lose the SCLD lines there) and make it a die(_(..)) instead of fprintf here.
Thanks, Stefan