From: Junio C Hamano Date: Tue, 17 Jun 2008 05:19:00 +0000 (-0700) Subject: sha1_file.c: simplify parse_pack_index() X-Git-Tag: v1.5.6~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=79c6dca413094d2df74e7050f1185963b00e9245;p=git.git sha1_file.c: simplify parse_pack_index() It was implemented as a thin wrapper around an otherwise unused helper function parse_pack_index_file(). The code becomes simpler and easier to read by consolidating the two. Signed-off-by: Junio C Hamano --- diff --git a/cache.h b/cache.h index 23f3b9233..81b7e17de 100644 --- a/cache.h +++ b/cache.h @@ -694,8 +694,6 @@ extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, ch extern int server_supports(const char *feature); extern struct packed_git *parse_pack_index(unsigned char *sha1); -extern struct packed_git *parse_pack_index_file(const unsigned char *sha1, - const char *idx_path); extern void prepare_packed_git(void); extern void reprepare_packed_git(void); diff --git a/sha1_file.c b/sha1_file.c index e300562c1..191f814e0 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -831,13 +831,7 @@ struct packed_git *add_packed_git(const char *path, int path_len, int local) struct packed_git *parse_pack_index(unsigned char *sha1) { - char *path = sha1_pack_index_name(sha1); - return parse_pack_index_file(sha1, path); -} - -struct packed_git *parse_pack_index_file(const unsigned char *sha1, - const char *idx_path) -{ + const char *idx_path = sha1_pack_index_name(sha1); const char *path = sha1_pack_name(sha1); struct packed_git *p = xmalloc(sizeof(*p) + strlen(path) + 2);