mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 21:34:15 +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".
57 lines
1.2 KiB
C
57 lines
1.2 KiB
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_repository_h__
|
|
#define INCLUDE_repository_h__
|
|
|
|
#include "git2/common.h"
|
|
#include "git2/oid.h"
|
|
#include "git2/odb.h"
|
|
#include "git2/repository.h"
|
|
#include "git2/object.h"
|
|
|
|
#include "hashtable.h"
|
|
#include "index.h"
|
|
#include "cache.h"
|
|
#include "refs.h"
|
|
#include "buffer.h"
|
|
#include "odb.h"
|
|
|
|
#define DOT_GIT ".git"
|
|
#define GIT_DIR DOT_GIT "/"
|
|
#define GIT_DIR_MODE 0755
|
|
#define GIT_BARE_DIR_MODE 0777
|
|
|
|
struct git_object {
|
|
git_cached_obj cached;
|
|
git_repository *repo;
|
|
git_otype type;
|
|
};
|
|
|
|
struct git_repository {
|
|
git_odb *db;
|
|
|
|
git_cache objects;
|
|
git_refcache references;
|
|
|
|
char *path_repository;
|
|
char *path_index;
|
|
char *path_odb;
|
|
char *path_workdir;
|
|
|
|
unsigned is_bare:1;
|
|
unsigned int lru_counter;
|
|
};
|
|
|
|
/* fully free the object; internal method, do not
|
|
* export */
|
|
void git_object__free(void *object);
|
|
|
|
int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end, const char *header);
|
|
void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid);
|
|
|
|
#endif
|