Skip to content

Commit 79c6dca

Browse files
committed
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 <[email protected]>
1 parent 3bfaf01 commit 79c6dca

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

cache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,6 @@ extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, ch
694694
extern int server_supports(const char *feature);
695695

696696
extern struct packed_git *parse_pack_index(unsigned char *sha1);
697-
extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
698-
const char *idx_path);
699697

700698
extern void prepare_packed_git(void);
701699
extern void reprepare_packed_git(void);

sha1_file.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -831,13 +831,7 @@ struct packed_git *add_packed_git(const char *path, int path_len, int local)
831831

832832
struct packed_git *parse_pack_index(unsigned char *sha1)
833833
{
834-
char *path = sha1_pack_index_name(sha1);
835-
return parse_pack_index_file(sha1, path);
836-
}
837-
838-
struct packed_git *parse_pack_index_file(const unsigned char *sha1,
839-
const char *idx_path)
840-
{
834+
const char *idx_path = sha1_pack_index_name(sha1);
841835
const char *path = sha1_pack_name(sha1);
842836
struct packed_git *p = xmalloc(sizeof(*p) + strlen(path) + 2);
843837

0 commit comments

Comments
 (0)