summaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2005-10-13 15:38:28 -0700
committerJunio C Hamano <junkio@cox.net>2005-10-13 15:38:28 -0700
commit9d835df246e81a6a03e3f633280c45e683e4c673 (patch)
treea878e0f1ab86c47489300b4ae23bc6f8736faddb /sha1_file.c
parent73319032c8d2b2c73138d5caee1d2838fe1305d2 (diff)
downloadgit-9d835df246e81a6a03e3f633280c45e683e4c673.tar.gz
Keep track of whether a pack is local or not
If we want to re-pack just local packfiles, we need to know whether a particular object is local or not. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sha1_file.c b/sha1_file.c
index f059004909..e45679975e 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -416,7 +416,7 @@ int use_packed_git(struct packed_git *p)
return 0;
}
-struct packed_git *add_packed_git(char *path, int path_len)
+struct packed_git *add_packed_git(char *path, int path_len, int local)
{
struct stat st;
struct packed_git *p;
@@ -444,6 +444,7 @@ struct packed_git *add_packed_git(char *path, int path_len)
p->pack_base = NULL;
p->pack_last_used = 0;
p->pack_use_cnt = 0;
+ p->pack_local = local;
return p;
}
@@ -484,7 +485,7 @@ void install_packed_git(struct packed_git *pack)
packed_git = pack;
}
-static void prepare_packed_git_one(char *objdir)
+static void prepare_packed_git_one(char *objdir, int local)
{
char path[PATH_MAX];
int len;
@@ -506,7 +507,7 @@ static void prepare_packed_git_one(char *objdir)
/* we have .idx. Is it a file we can map? */
strcpy(path + len, de->d_name);
- p = add_packed_git(path, len + namelen);
+ p = add_packed_git(path, len + namelen, local);
if (!p)
continue;
p->next = packed_git;
@@ -522,11 +523,11 @@ void prepare_packed_git(void)
if (run_once)
return;
- prepare_packed_git_one(get_object_directory());
+ prepare_packed_git_one(get_object_directory(), 1);
prepare_alt_odb();
for (alt = alt_odb_list; alt; alt = alt->next) {
alt->name[0] = 0;
- prepare_packed_git_one(alt->base);
+ prepare_packed_git_one(alt->base, 0);
}
run_once = 1;
}