summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9245ddd)
raw | patch | inline | side by side (parent: 9245ddd)
author | Brandon Casey <drafnel@gmail.com> | |
Wed, 12 Nov 2008 17:59:03 +0000 (11:59 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 12 Nov 2008 18:28:08 +0000 (10:28 -0800) |
pack_keep will be set when a pack file has an associated .keep file.
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
sha1_file.c | patch | blob | history |
index a1e4982cd424ec5c3695c2221583bca1bd861614..1a5740f5899628b2d2b3ed063b81f89a21308d67 100644 (file)
--- a/cache.h
+++ b/cache.h
int index_version;
time_t mtime;
int pack_fd;
- int pack_local;
+ unsigned pack_local:1,
+ pack_keep:1;
unsigned char sha1[20];
/* something like ".git/objects/pack/xxxxx.pack" */
char pack_name[FLEX_ARRAY]; /* more */
diff --git a/sha1_file.c b/sha1_file.c
index 12fc767ee57103739e568a959981ca559417ecf4..adb116350bd38db0390f4f731e509f3fe703a1c1 100644 (file)
--- a/sha1_file.c
+++ b/sha1_file.c
return NULL;
}
memcpy(p->pack_name, path, path_len);
+
+ strcpy(p->pack_name + path_len, ".keep");
+ if (!access(p->pack_name, F_OK))
+ p->pack_keep = 1;
+
strcpy(p->pack_name + path_len, ".pack");
if (stat(p->pack_name, &st) || !S_ISREG(st.st_mode)) {
free(p);