Re: [PATCH v2 2/5] enter_repo: avoid duplicating logic, use is_git_directory() instead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---

The cover letter talks about "local clone", and in this entire
series, I saw new tests only for the local case, but doesn't this
and the next change also affect the case where a Git daemon or a
upload-pack process is serving the remote repository?

And if so, how is that case affected?

>  path.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/path.c b/path.c
> index a536ee3..7340e11 100644
> --- a/path.c
> +++ b/path.c
> @@ -441,8 +441,7 @@ const char *enter_repo(const char *path, int strict)
>  	else if (chdir(path))
>  		return NULL;
>  
> -	if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 &&
> -	    validate_headref("HEAD") == 0) {
> +	if (is_git_directory(".")) {
>  		set_git_dir(".");
>  		check_repository_format();
>  		return path;
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]