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

2017-06-10 Thread Jeff King
On Thu, Jun 08, 2017 at 09:53:32PM +0200, 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

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

2017-06-08 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