Re: Make ref resolution saner

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

 




On Tue, 12 Sep 2006, Jeff King wrote:
> 
> I assume your patch is against master;

Yeah. Well, master plus my previous patches.

> it looks like there's exactly one call to resolve_ref that's in next but 
> not master. One-liner fix below.

Not quite enough. It's the same thing: wt-status.c plays games with the 
return value (which _used_ to be a path) in order to turn it back into a 
ref. But now that it's all about refs, the games are unnecessary:

> diff --git a/wt-status.c b/wt-status.c
> index ec2c728..e2f49c7 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -41,7 +41,7 @@ void wt_status_prepare(struct wt_status 
>  
>  	s->is_initial = get_sha1("HEAD", sha1) ? 1 : 0;
>  
> -	head = resolve_ref(git_path("HEAD"), sha1, 0);
> +	head = resolve_ref("HEAD", sha1, 0);
>  	s->branch = head ?
>  		    strdup(head + strlen(get_git_dir()) + 1) :
>  		    NULL;

So that "strdup(head + strlen(get_git_dir()) + 1)" should now be just 
"strdup(head)".

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