| 1 | /* | ||
| 2 | * Copyright (C) the libgit2 contributors. All rights reserved. | ||
| 3 | * | ||
| 4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | ||
| 5 | * a Linking Exception. For full terms see the included COPYING file. | ||
| 6 | */ | ||
| 7 | #ifndef INCLUDE_reflog_h__ | ||
| 8 | #define INCLUDE_reflog_h__ | ||
| 9 | |||
| 10 | #include "common.h" | ||
| 11 | |||
| 12 | #include "git2/reflog.h" | ||
| 13 | #include "vector.h" | ||
| 14 | |||
| 15 | #define GIT_REFLOG_DIR "logs/" | ||
| 16 | #define GIT_REFLOG_DIR_MODE 0777 | ||
| 17 | #define GIT_REFLOG_FILE_MODE 0666 | ||
| 18 | |||
| 19 | #define GIT_REFLOG_SIZE_MIN (2*GIT_OID_HEXSZ+2+17) | ||
| 20 | |||
| 21 | struct git_reflog_entry { | ||
| 22 | git_oid oid_old; | ||
| 23 | git_oid oid_cur; | ||
| 24 | |||
| 25 | git_signature *committer; | ||
| 26 | |||
| 27 | char *msg; | ||
| 28 | }; | ||
| 29 | |||
| 30 | struct git_reflog { | ||
| 31 | git_refdb *db; | ||
| 32 | char *ref_name; | ||
| 33 | git_vector entries; | ||
| 34 | }; | ||
| 35 | |||
| 36 | 49 | GIT_INLINE(size_t) reflog_inverse_index(size_t idx, size_t total) | |
| 37 | { | ||
| 38 | 49 | return (total - 1) - idx; | |
| 39 | } | ||
| 40 | |||
| 41 | #endif |