Re: [PATCH v3 02/25] Convert git_snpath() to strbuf_git_path()

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

 



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

> @@ -2717,17 +2729,19 @@ static int copy_msg(char *buf, const char *msg)
>  	return cp - buf;
>  }
>  
> -int log_ref_setup(const char *refname, char *logfile, int bufsize)
> +int log_ref_setup(const char *refname, struct strbuf *sb_logfile)
>  {
>  	int logfd, oflags = O_APPEND | O_WRONLY;
> +	const char *logfile;
>  
> -	git_snpath(logfile, bufsize, "logs/%s", refname);
> +	strbuf_git_path(sb_logfile, "logs/%s", refname);
> +	logfile = sb_logfile->buf;
>  	if (log_all_ref_updates &&
>  	    (starts_with(refname, "refs/heads/") ||
>  	     starts_with(refname, "refs/remotes/") ||
>  	     starts_with(refname, "refs/notes/") ||
>  	     !strcmp(refname, "HEAD"))) {
> -		if (safe_create_leading_directories(logfile) < 0)
> +		if (safe_create_leading_directories(sb_logfile->buf) < 0)

Other references to logfile in this function are kept as-is, and I
think this line can also stay as-it-was.  That is the whole point of
introducing the local variable logfile and assinging to it upfront
as a synonym, isn't it?
--
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]