Re: [PATCHv5 2/8] commit.c: new function for looking up a comit by name

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

 



s/comit/commit/;

"Pat Notz" <patnotz@xxxxxxxxx> writes:

> diff --git a/commit.c b/commit.c
> index 0094ec1..f51098a 100644
> --- a/commit.c
> +++ b/commit.c
> @@ -49,6 +49,19 @@ struct commit *lookup_commit(const unsigned char *sha1)
>  	return check_commit(obj, sha1, 0);
>  }
>  
> +struct commit *lookup_commit_reference_by_name(const char *name)
> +{
> +	unsigned char sha1[20];
> +	struct commit *commit;
> +
> +	if (get_sha1(name, sha1))
> +		die("could not lookup commit %s", name);
> +	commit = lookup_commit_reference(sha1);
> +	if (!commit || parse_commit(commit))
> +		die("could not parse commit %s", name);
> +	return commit;
> +}

Although this wouldn't _hurt_, not very excited without seeing codepaths
that can use this helper to reduce lines (there should be a lot of places,
I would think).  And when that happens, the helper that dies would not be
very useful, as some potential callers that can benefit may want to decide
what messages to issue themselves.
--
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]