Make walker.fetch_ref() take a struct ref.

This simplifies a few things, makes a few things slightly more
complicated, but, more importantly, allows that, when struct ref can
represent a symref, http_fetch_ref() can return one.

Incidentally makes the string that http_fetch_ref() gets include "refs/"
(if appropriate), because that's how the name field of struct ref works.
As far as I can tell, the usage in walker:interpret_target() wouldn't have
worked previously, if it ever would have been used, which it wouldn't
(since the fetch process uses the hash instead of the name of the ref
there).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Daniel Barkalow
2008-04-26 15:53:09 -04:00
committed by Junio C Hamano
parent 36c79d2bf8
commit c13b2633f4
6 changed files with 36 additions and 27 deletions

View File

@ -888,10 +888,10 @@ static int fetch(struct walker *walker, unsigned char *sha1)
data->alt->base);
}
static int fetch_ref(struct walker *walker, char *ref, unsigned char *sha1)
static int fetch_ref(struct walker *walker, struct ref *ref)
{
struct walker_data *data = walker->data;
return http_fetch_ref(data->alt->base, ref, sha1);
return http_fetch_ref(data->alt->base, ref);
}
static void cleanup(struct walker *walker)