@matheusbsbs / matheus-bagliano / commits / 79c6dca413
Fork 0

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 <gitster@pobox.com>

Junio C Hamano committed Jun 16, 2008 at 22:19 UTC 79c6dca413094d2df74e7050f1185963b00e9245
2 files changed +1 -9
cache.h
-2
@@ -694,8 +694,6 @@ extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, ch
694 extern int server_supports(const char *feature);
695
696 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);
697
698 extern void prepare_packed_git(void);
699 extern void reprepare_packed_git(void);
sha1_file.c
+1 -7
@@ -831,13 +831,7 @@ struct packed_git *add_packed_git(const char *path, int path_len, int local)
831
832 struct packed_git *parse_pack_index(unsigned char *sha1)
833 {
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);
835 const char *path = sha1_pack_name(sha1);
836 struct packed_git *p = xmalloc(sizeof(*p) + strlen(path) + 2);
837