mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-22 19:19:41 +00:00

The following files now have 0444 permissions: - loose objects - pack indexes - pack files - packs downloaded by fetch - packs downloaded by the HTTP transport And the following files now have 0666 permissions: - config files - repository indexes - reflogs - refs This brings libgit2 more in line with Git. Note that git_filebuf_commit() and git_filebuf_commit_at() have both gained a new mode parameter. The latter change fixes an important issue where filebufs created with GIT_FILEBUF_TEMPORARY received 0600 permissions (due to mkstemp(3) usage). Now we chmod() the file before renaming it into place. Tests have been added to confirm that new commit, tag, and tree objects are created with the right permissions. I don't have access to Windows, so for now I've guarded the tests with "#ifndef GIT_WIN32".
34 lines
654 B
C
34 lines
654 B
C
/*
|
|
* Copyright (C) 2009-2011 the libgit2 contributors
|
|
*
|
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
|
* a Linking Exception. For full terms see the included COPYING file.
|
|
*/
|
|
#ifndef INCLUDE_index_h__
|
|
#define INCLUDE_index_h__
|
|
|
|
#include "fileops.h"
|
|
#include "filebuf.h"
|
|
#include "vector.h"
|
|
#include "tree-cache.h"
|
|
#include "git2/odb.h"
|
|
#include "git2/index.h"
|
|
|
|
#define GIT_INDEX_FILE "index"
|
|
#define GIT_INDEX_FILE_MODE 0666
|
|
|
|
struct git_index {
|
|
git_repository *repository;
|
|
char *index_file_path;
|
|
|
|
time_t last_modified;
|
|
git_vector entries;
|
|
|
|
unsigned int on_disk:1;
|
|
git_tree_cache *tree;
|
|
|
|
git_vector unmerged;
|
|
};
|
|
|
|
#endif
|