Re: [PATCH v9 1/9] git-clean: refactor git-clean into two phases

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

 



Jiang Xin <worldhello.net@xxxxxxxxx> writes:

> +/*
> + * Give path as relative to prefix.
> + *
> + * This function is a combination of path_relative (in quote.c) and
> + * relative_path (in path.c)
> + */
> +static const char *path_relative(const char *in, const char *prefix)
> +{
> +...

Hmph.  Is it possible to reuse the public one (in path.c) here and
in quote.c, perhaps after enhancing it a bit to serve needs of the
callers of two existing ones and the new callers of this one?

> @@ -242,11 +287,6 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
>  				continue; /* Yup, this one exists unmerged */
>  		}
>  
> -		/*
> -		 * we might have removed this as part of earlier
> -		 * recursive directory removal, so lstat() here could
> -		 * fail with ENOENT.
> -		 */
>  		if (lstat(ent->name, &st))
>  			continue;

I am guessing that the reason why you removed the comment is because
during this phase there is no way we "might have removed".  But if
that is the case, does it still make sense to run lstat() and ignore
errors from the call?

--
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]