summaryrefslogtreecommitdiff
path: root/src/refs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/refs.c')
-rw-r--r--src/refs.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/refs.c b/src/refs.c
index 563406660..05f935796 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -16,6 +16,8 @@
#define MAX_NESTING_LEVEL 5
+#define GIT_PACKED_REFS_FILE_MODE 0644
+
enum {
GIT_PACKREF_HAS_PEEL = 1,
GIT_PACKREF_WAS_LOOSE = 2
@@ -757,7 +759,7 @@ static int packed_write(git_repository *repo)
total_refs = repo->references.packfile->key_count;
if ((error =
git_vector_init(&packing_list, total_refs, packed_sort)) < GIT_SUCCESS)
- return git__rethrow(error, "Failed to write packed reference");
+ return git__rethrow(error, "Failed to init packed refernces list");
/* Load all the packfile into a vector */
{
@@ -776,14 +778,14 @@ static int packed_write(git_repository *repo)
/* Now we can open the file! */
git_path_join(pack_file_path, repo->path_repository, GIT_PACKEDREFS_FILE);
if ((error = git_filebuf_open(&pack_file, pack_file_path, 0)) < GIT_SUCCESS)
- return git__rethrow(error, "Failed to write packed reference");
+ return git__rethrow(error, "Failed to write open packed references file");
/* Packfiles have a header... apparently
* This is in fact not required, but we might as well print it
* just for kicks */
if ((error =
git_filebuf_printf(&pack_file, "%s\n", GIT_PACKEDREFS_HEADER)) < GIT_SUCCESS)
- return git__rethrow(error, "Failed to write packed reference");
+ return git__rethrow(error, "Failed to write packed references file header");
for (i = 0; i < packing_list.length; ++i) {
struct packref *ref = (struct packref *)git_vector_get(&packing_list, i);
@@ -802,7 +804,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_PACK_FILE_MODE);
+ error = git_filebuf_commit(&pack_file, GIT_PACKED_REFS_FILE_MODE);
/* when and only when the packfile has been properly written,
* we can go ahead and remove the loose refs */
@@ -821,7 +823,7 @@ cleanup:
return error == GIT_SUCCESS ?
GIT_SUCCESS :
- git__rethrow(error, "Failed to write packed reference");
+ git__rethrow(error, "Failed to write packed references file");
}
static int _reference_available_cb(const char *ref, void *data)