Re: [PATCH v2] fetch-pack: fix object_id of exact sha1

2016-02-29 Thread Jeff King
On Mon, Feb 29, 2016 at 11:08:07PM -0300, Gabriel Souza Franco wrote: > On Mon, Feb 29, 2016 at 5:30 AM, Johannes Schindelin > wrote: > > Having said that, this *might* be a good opportunity to imitate the > > skip_prefix() function. If there are enough similar code constructs, we > > could simpl

Re: [PATCH v2] fetch-pack: fix object_id of exact sha1

2016-02-29 Thread Gabriel Souza Franco
On Mon, Feb 29, 2016 at 5:30 AM, Johannes Schindelin wrote: > Having said that, this *might* be a good opportunity to imitate the > skip_prefix() function. If there are enough similar code constructs, we > could simplify all of them by introducing the function > > skip_oid_hex(const char *

Re: [PATCH v2] fetch-pack: fix object_id of exact sha1

2016-02-29 Thread Jeff King
On Sun, Feb 28, 2016 at 07:22:24PM -0300, Gabriel Souza Franco wrote: > Commit 58f2ed0 (remote-curl: pass ref SHA-1 to fetch-pack as well, > 2013-12-05) added support for specifying a SHA-1 as well as a ref name. > Add support for specifying just a SHA-1 and set the ref name to the same > value in

Re: [PATCH v2] fetch-pack: fix object_id of exact sha1

2016-02-29 Thread Johannes Schindelin
Hi Gabriel, On Sun, 28 Feb 2016, Gabriel Souza Franco wrote: > Not the cleanest conditional I've ever written, but it should handle > all cases correctly. It could be much worse: > + if (get_oid_hex(name, &oid) || > + (name[GIT_SHA1_HEXSZ] != ' ' && > +

[PATCH v2] fetch-pack: fix object_id of exact sha1

2016-02-28 Thread Gabriel Souza Franco
Commit 58f2ed0 (remote-curl: pass ref SHA-1 to fetch-pack as well, 2013-12-05) added support for specifying a SHA-1 as well as a ref name. Add support for specifying just a SHA-1 and set the ref name to the same value in this case. Signed-off-by: Gabriel Souza Franco --- Not the cleanest conditi