1. Stefan Saasen
  2. git


Junio C Hamano  committed 79c6dca

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>

  • Participants
  • Parent commits 3bfaf01
  • Branches master

Comments (0)

Files changed (2)

File cache.h

View file
 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);

File sha1_file.c

View file
 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);