Skip to content

Commit

Permalink
sha1_file.c: simplify parse_pack_index()
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jun 17, 2008
1 parent 3bfaf01 commit 79c6dca
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
8 changes: 1 addition & 7 deletions sha1_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 79c6dca

Please sign in to comment.