From 7096d0f9e47d39a8fd4f315a7633f3b86a7d6c93 Mon Sep 17 00:00:00 2001 From: Brodie Rao Date: Wed, 16 Nov 2011 11:36:13 -0800 Subject: [PATCH 1/2] refs: use 0666 permissions when writing packed-refs, not 0644 This matches stock Git's behavior. --- src/refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/refs.c b/src/refs.c index 05f935796..4f32f4400 100644 --- a/src/refs.c +++ b/src/refs.c @@ -16,7 +16,7 @@ #define MAX_NESTING_LEVEL 5 -#define GIT_PACKED_REFS_FILE_MODE 0644 +#define GIT_PACKED_REFS_FILE_MODE 0666 enum { GIT_PACKREF_HAS_PEEL = 1, From 9788e72ad4443dbcaa7aef92f09aaba7ffc3a98b Mon Sep 17 00:00:00 2001 From: Brodie Rao Date: Wed, 16 Nov 2011 11:39:03 -0800 Subject: [PATCH 2/2] refs: move GIT_PACKED_REFS_FILE_MODE to refs.h as GIT_PACKEDREFS_FILE_MODE This groups the #define with the other ref-related file modes, and it makes the name consistent with the other packed-refs definitions. --- src/refs.c | 4 +--- src/refs.h | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/refs.c b/src/refs.c index 4f32f4400..569efbf78 100644 --- a/src/refs.c +++ b/src/refs.c @@ -16,8 +16,6 @@ #define MAX_NESTING_LEVEL 5 -#define GIT_PACKED_REFS_FILE_MODE 0666 - enum { GIT_PACKREF_HAS_PEEL = 1, GIT_PACKREF_WAS_LOOSE = 2 @@ -804,7 +802,7 @@ cleanup: /* if we've written all the references properly, we can commit * the packfile to make the changes effective */ if (error == GIT_SUCCESS) { - error = git_filebuf_commit(&pack_file, GIT_PACKED_REFS_FILE_MODE); + error = git_filebuf_commit(&pack_file, GIT_PACKEDREFS_FILE_MODE); /* when and only when the packfile has been properly written, * we can go ahead and remove the loose refs */ diff --git a/src/refs.h b/src/refs.h index 02e336e54..c90f5bcc4 100644 --- a/src/refs.h +++ b/src/refs.h @@ -24,6 +24,7 @@ #define GIT_SYMREF "ref: " #define GIT_PACKEDREFS_FILE "packed-refs" #define GIT_PACKEDREFS_HEADER "# pack-refs with: peeled " +#define GIT_PACKEDREFS_FILE_MODE 0666 #define GIT_HEAD_FILE "HEAD" #define GIT_FETCH_HEAD_FILE "FETCH_HEAD"