Re: [PATCH 3/4] clone: factor out dir_exists() helper

2018-01-05 Thread Junio C Hamano
Jeff King writes: > On Thu, Jan 04, 2018 at 06:54:12PM -0500, Jeff King wrote: > >> > If we really want to be anal, perhaps a new helper path_exists() >> > that cares only about existence of paths (i.e. the implementation of >> > these two helpers they currently have), together with update to >>

Re: [PATCH 3/4] clone: factor out dir_exists() helper

2018-01-04 Thread Jeff King
On Thu, Jan 04, 2018 at 06:54:12PM -0500, Jeff King wrote: > > If we really want to be anal, perhaps a new helper path_exists() > > that cares only about existence of paths (i.e. the implementation of > > these two helpers they currently have), together with update to > > check the st.st_mode for

Re: [PATCH 3/4] clone: factor out dir_exists() helper

2018-01-04 Thread Jeff King
On Thu, Jan 04, 2018 at 03:47:18PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > Two parts of git-clone's setup logic check whether a > > directory exists, and they both call stat directly with the > > same scratch "struct stat" buffer. Let's pull that into a > > helper, which has a few

Re: [PATCH 3/4] clone: factor out dir_exists() helper

2018-01-04 Thread Junio C Hamano
Jeff King writes: > Two parts of git-clone's setup logic check whether a > directory exists, and they both call stat directly with the > same scratch "struct stat" buffer. Let's pull that into a > helper, which has a few advantages: > > - it makes the purpose of the stat calls more obvious > >

[PATCH 3/4] clone: factor out dir_exists() helper

2018-01-02 Thread Jeff King
Two parts of git-clone's setup logic check whether a directory exists, and they both call stat directly with the same scratch "struct stat" buffer. Let's pull that into a helper, which has a few advantages: - it makes the purpose of the stat calls more obvious - it makes it clear that we don'