mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 18:57:46 +00:00
Properly tag all enums
with a _t
This commit is contained in:
parent
4fbd1c007e
commit
2e2e97858d
@ -69,7 +69,7 @@ GIT_EXTERN(int) git_branch_create(
|
||||
GIT_EXTERN(int) git_branch_delete(
|
||||
git_repository *repo,
|
||||
const char *branch_name,
|
||||
git_branch_type branch_type);
|
||||
git_branch_t branch_type);
|
||||
|
||||
/**
|
||||
* Fill a list with all the branches in the Repository
|
||||
|
@ -74,6 +74,13 @@ struct git_odb_backend {
|
||||
void (* free)(struct git_odb_backend *);
|
||||
};
|
||||
|
||||
/** Streaming mode */
|
||||
enum {
|
||||
GIT_STREAM_RDONLY = (1 << 1),
|
||||
GIT_STREAM_WRONLY = (1 << 2),
|
||||
GIT_STREAM_RW = (GIT_STREAM_RDONLY | GIT_STREAM_WRONLY),
|
||||
};
|
||||
|
||||
/** A stream to read/write from a backend */
|
||||
struct git_odb_stream {
|
||||
struct git_odb_backend *backend;
|
||||
@ -85,13 +92,6 @@ struct git_odb_stream {
|
||||
void (*free)(struct git_odb_stream *stream);
|
||||
};
|
||||
|
||||
/** Streaming mode */
|
||||
typedef enum {
|
||||
GIT_STREAM_RDONLY = (1 << 1),
|
||||
GIT_STREAM_WRONLY = (1 << 2),
|
||||
GIT_STREAM_RW = (GIT_STREAM_RDONLY | GIT_STREAM_WRONLY),
|
||||
} git_odb_streammode;
|
||||
|
||||
GIT_EXTERN(int) git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir);
|
||||
GIT_EXTERN(int) git_odb_backend_loose(git_odb_backend **backend_out, const char *objects_dir, int compression_level, int do_fsync);
|
||||
|
||||
|
@ -111,7 +111,7 @@ GIT_EXTERN(const char *) git_reference_target(git_reference *ref);
|
||||
* @param ref The reference
|
||||
* @return the type
|
||||
*/
|
||||
GIT_EXTERN(git_rtype) git_reference_type(git_reference *ref);
|
||||
GIT_EXTERN(git_ref_t) git_reference_type(git_reference *ref);
|
||||
|
||||
/**
|
||||
* Get the full name of a reference
|
||||
|
@ -19,19 +19,19 @@
|
||||
*/
|
||||
GIT_BEGIN_DECL
|
||||
|
||||
#define GIT_STATUS_CURRENT 0
|
||||
enum {
|
||||
GIT_STATUS_CURRENT = 0,
|
||||
|
||||
/** Flags for index status */
|
||||
#define GIT_STATUS_INDEX_NEW (1 << 0)
|
||||
#define GIT_STATUS_INDEX_MODIFIED (1 << 1)
|
||||
#define GIT_STATUS_INDEX_DELETED (1 << 2)
|
||||
GIT_STATUS_INDEX_NEW = (1 << 0),
|
||||
GIT_STATUS_INDEX_MODIFIED = (1 << 1),
|
||||
GIT_STATUS_INDEX_DELETED = (1 << 2),
|
||||
|
||||
/** Flags for worktree status */
|
||||
#define GIT_STATUS_WT_NEW (1 << 3)
|
||||
#define GIT_STATUS_WT_MODIFIED (1 << 4)
|
||||
#define GIT_STATUS_WT_DELETED (1 << 5)
|
||||
GIT_STATUS_WT_NEW = (1 << 3),
|
||||
GIT_STATUS_WT_MODIFIED = (1 << 4),
|
||||
GIT_STATUS_WT_DELETED = (1 << 5),
|
||||
|
||||
#define GIT_STATUS_IGNORED (1 << 6)
|
||||
GIT_STATUS_IGNORED = (1 << 6),
|
||||
};
|
||||
|
||||
/**
|
||||
* Gather file statuses and run a callback for each one.
|
||||
@ -97,11 +97,14 @@ typedef enum {
|
||||
* slash on the entry name). Given this flag, the directory
|
||||
* itself will not be included, but all the files in it will.
|
||||
*/
|
||||
#define GIT_STATUS_OPT_INCLUDE_UNTRACKED (1 << 0)
|
||||
#define GIT_STATUS_OPT_INCLUDE_IGNORED (1 << 1)
|
||||
#define GIT_STATUS_OPT_INCLUDE_UNMODIFIED (1 << 2)
|
||||
#define GIT_STATUS_OPT_EXCLUDE_SUBMODULES (1 << 3)
|
||||
#define GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS (1 << 4)
|
||||
|
||||
enum {
|
||||
GIT_STATUS_OPT_INCLUDE_UNTRACKED = (1 << 0),
|
||||
GIT_STATUS_OPT_INCLUDE_IGNORED = (1 << 1),
|
||||
GIT_STATUS_OPT_INCLUDE_UNMODIFIED = (1 << 2),
|
||||
GIT_STATUS_OPT_EXCLUDE_SUBMODULED = (1 << 3),
|
||||
GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS = (1 << 4),
|
||||
};
|
||||
|
||||
/**
|
||||
* Options to control how callbacks will be made by
|
||||
|
@ -158,13 +158,13 @@ typedef enum {
|
||||
GIT_REF_PACKED = 4,
|
||||
GIT_REF_HAS_PEEL = 8,
|
||||
GIT_REF_LISTALL = GIT_REF_OID|GIT_REF_SYMBOLIC|GIT_REF_PACKED,
|
||||
} git_rtype;
|
||||
} git_ref_t;
|
||||
|
||||
/** Basic type of any Git branch. */
|
||||
typedef enum {
|
||||
GIT_BRANCH_LOCAL = 1,
|
||||
GIT_BRANCH_REMOTE = 2,
|
||||
} git_branch_type;
|
||||
} git_branch_t;
|
||||
|
||||
typedef struct git_refspec git_refspec;
|
||||
typedef struct git_remote git_remote;
|
||||
|
@ -105,7 +105,7 @@ cleanup:
|
||||
return error;
|
||||
}
|
||||
|
||||
int git_branch_delete(git_repository *repo, const char *branch_name, git_branch_type branch_type)
|
||||
int git_branch_delete(git_repository *repo, const char *branch_name, git_branch_t branch_type)
|
||||
{
|
||||
git_reference *branch = NULL;
|
||||
git_reference *head = NULL;
|
||||
|
@ -194,10 +194,10 @@ corrupt:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static git_rtype loose_guess_rtype(const git_buf *full_path)
|
||||
static git_ref_t loose_guess_rtype(const git_buf *full_path)
|
||||
{
|
||||
git_buf ref_file = GIT_BUF_INIT;
|
||||
git_rtype type;
|
||||
git_ref_t type;
|
||||
|
||||
type = GIT_REF_INVALID;
|
||||
|
||||
@ -1153,7 +1153,7 @@ int git_reference_lookup_resolved(
|
||||
/**
|
||||
* Getters
|
||||
*/
|
||||
git_rtype git_reference_type(git_reference *ref)
|
||||
git_ref_t git_reference_type(git_reference *ref)
|
||||
{
|
||||
assert(ref);
|
||||
|
||||
|
@ -75,7 +75,7 @@ void test_refs_branches_delete__can_delete_a_remote_branch(void)
|
||||
cl_git_pass(git_branch_delete(repo, "nulltoken/master", GIT_BRANCH_REMOTE));
|
||||
}
|
||||
|
||||
static void assert_non_exisitng_branch_removal(const char *branch_name, git_branch_type branch_type)
|
||||
static void assert_non_exisitng_branch_removal(const char *branch_name, git_branch_t branch_type)
|
||||
{
|
||||
int error;
|
||||
error = git_branch_delete(repo, branch_name, branch_type);
|
||||
|
Loading…
Reference in New Issue
Block a user