Re: [PATCH 1/9] discover_git_directory(): avoid setting invalid git_dir

2017-06-08 Thread Johannes Schindelin
Hi Brandon, On Wed, 7 Jun 2017, Brandon Williams wrote: > On 06/07, Johannes Schindelin wrote: > > > diff --git a/setup.c b/setup.c > > index e3f7699a902..2435186e448 100644 > > --- a/setup.c > > +++ b/setup.c > > @@ -982,6 +982,7 @@ const char *discover_git_directory(struct strbuf > > *gitdir)

Re: [PATCH 1/9] discover_git_directory(): avoid setting invalid git_dir

2017-06-07 Thread Brandon Williams
On 06/07, Johannes Schindelin wrote: > When discovering a .git/ directory, we take pains to ensure that its > repository format version matches Git's expectations, and we return NULL > otherwise. > > However, we still appended the invalid path to the strbuf passed as > argument. > > Let's just re

[PATCH 1/9] discover_git_directory(): avoid setting invalid git_dir

2017-06-07 Thread Johannes Schindelin
When discovering a .git/ directory, we take pains to ensure that its repository format version matches Git's expectations, and we return NULL otherwise. However, we still appended the invalid path to the strbuf passed as argument. Let's just reset the strbuf to the state before we appended the .g