aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorBrandon Casey <drafnel@gmail.com>2008-11-12 11:59:03 -0600
committerJunio C Hamano <gitster@pobox.com>2008-11-12 10:28:08 -0800
commit8d25931d6ff47a7fb06512d767d1d416d9bc7733 (patch)
tree81a5c69309c1eec4ad8bb723b20998b4a9aa4aa6 /sha1_file.c
parent9245ddd515d0fb5da52da4fd4dfc71460e98db90 (diff)
downloadgit-8d25931d6ff47a7fb06512d767d1d416d9bc7733.tar.gz
git-8d25931d6ff47a7fb06512d767d1d416d9bc7733.tar.xz
packed_git: convert pack_local flag into a bitfield and add pack_keep
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>
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 12fc767ee..adb116350 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -828,6 +828,11 @@ struct packed_git *add_packed_git(const char *path, int path_len, int local)
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);