summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7331903)
raw | patch | inline | side by side (parent: 7331903)
author | Linus Torvalds <torvalds@osdl.org> | |
Thu, 13 Oct 2005 22:38:28 +0000 (15:38 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 13 Oct 2005 22:38:28 +0000 (15:38 -0700) |
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>
particular object is local or not.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
sha1_file.c | patch | blob | history | |
verify-pack.c | patch | blob | history |
index 1a7e047d762a6f4eab05b6fc34e156c9886ceae9..328658235b8bb46132fd1717d9152f5f0cc9668e 100644 (file)
--- a/cache.h
+++ b/cache.h
void *pack_base;
unsigned int pack_last_used;
unsigned int pack_use_cnt;
+ int pack_local;
unsigned char sha1[20];
char pack_name[0]; /* something like ".git/objects/pack/xxxxx.pack" */
} *packed_git;
extern int use_packed_git(struct packed_git *);
extern void unuse_packed_git(struct packed_git *);
-extern struct packed_git *add_packed_git(char *, int);
+extern struct packed_git *add_packed_git(char *, int, int);
extern int num_packed_objects(const struct packed_git *p);
extern int nth_packed_object_sha1(const struct packed_git *, int, unsigned char*);
extern int find_pack_entry_one(const unsigned char *, struct pack_entry *, struct packed_git *);
diff --git a/sha1_file.c b/sha1_file.c
index f0590049098b5371bc72855acc5736f9d5f61e2b..e45679975e7fcbfae0497f25ab56b6bbd0ff1155 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
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;
p->pack_base = NULL;
p->pack_last_used = 0;
p->pack_use_cnt = 0;
+ p->pack_local = local;
return p;
}
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;
/* 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;
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;
}
diff --git a/verify-pack.c b/verify-pack.c
index 80b60a6b7cdfb2f45bb34331dbc372fcbabe8c5a..c99db9dd79315dff4ac19c79b35275cd02397e60 100644 (file)
--- a/verify-pack.c
+++ b/verify-pack.c
len--;
}
/* Should name foo.idx now */
- if ((g = add_packed_git(arg, len)))
+ if ((g = add_packed_git(arg, len, 1)))
break;
/* No? did you name just foo? */
strcpy(arg + len, ".idx");
len += 4;
- if ((g = add_packed_git(arg, len)))
+ if ((g = add_packed_git(arg, len, 1)))
break;
return error("packfile %s not found.", arg);
}