Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2005-08-16 08:10:03 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-16 23:09:33 +0400
commitc508df5edfe12b9df7dfea4d438c1dab2812b3e9 (patch)
tree2d60fa6a1e2248728c250d4479df97a037771679 /sha1_file.c
parentb0921331030d52febf52839753eee1b2b9ca1f24 (diff)
[PATCH] Add function to read an index file from an arbitrary filename.
Note that the pack file has to be in the usual location if it gets installed later. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 2d109f928b..b6ebbc5c9a 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -476,12 +476,18 @@ struct packed_git *add_packed_git(char *path, int path_len)
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(unsigned char *sha1, char *idx_path)
+{
struct packed_git *p;
unsigned long idx_size;
void *idx_map;
- char *path = sha1_pack_index_name(sha1);
+ char *path;
- if (check_packed_git_idx(path, &idx_size, &idx_map))
+ if (check_packed_git_idx(idx_path, &idx_size, &idx_map))
return NULL;
path = sha1_pack_name(sha1);