Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
2e2e9785
Commit
2e2e9785
authored
May 18, 2012
by
Vicent Martí
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly tag all `enums` with a `_t`
parent
4fbd1c00
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
31 deletions
+34
-31
include/git2/branch.h
+1
-1
include/git2/odb_backend.h
+7
-7
include/git2/refs.h
+1
-1
include/git2/status.h
+18
-15
include/git2/types.h
+2
-2
src/branch.c
+1
-1
src/refs.c
+3
-3
tests-clar/refs/branches/delete.c
+1
-1
No files found.
include/git2/branch.h
View file @
2e2e9785
...
...
@@ -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_t
ype
branch_type
);
git_branch_t
branch_type
);
/**
* Fill a list with all the branches in the Repository
...
...
include/git2/odb_backend.h
View file @
2e2e9785
...
...
@@ -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
);
...
...
include/git2/refs.h
View file @
2e2e9785
...
...
@@ -111,7 +111,7 @@ GIT_EXTERN(const char *) git_reference_target(git_reference *ref);
* @param ref The reference
* @return the type
*/
GIT_EXTERN
(
git_r
type
)
git_reference_type
(
git_reference
*
ref
);
GIT_EXTERN
(
git_r
ef_t
)
git_reference_type
(
git_reference
*
ref
);
/**
* Get the full name of a reference
...
...
include/git2/status.h
View file @
2e2e9785
...
...
@@ -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
...
...
include/git2/types.h
View file @
2e2e9785
...
...
@@ -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_r
type
;
}
git_r
ef_t
;
/** Basic type of any Git branch. */
typedef
enum
{
GIT_BRANCH_LOCAL
=
1
,
GIT_BRANCH_REMOTE
=
2
,
}
git_branch_t
ype
;
}
git_branch_t
;
typedef
struct
git_refspec
git_refspec
;
typedef
struct
git_remote
git_remote
;
...
...
src/branch.c
View file @
2e2e9785
...
...
@@ -105,7 +105,7 @@ cleanup:
return
error
;
}
int
git_branch_delete
(
git_repository
*
repo
,
const
char
*
branch_name
,
git_branch_t
ype
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
;
...
...
src/refs.c
View file @
2e2e9785
...
...
@@ -194,10 +194,10 @@ corrupt:
return
-
1
;
}
static
git_r
type
loose_guess_rtype
(
const
git_buf
*
full_path
)
static
git_r
ef_t
loose_guess_rtype
(
const
git_buf
*
full_path
)
{
git_buf
ref_file
=
GIT_BUF_INIT
;
git_r
type
type
;
git_r
ef_t
type
;
type
=
GIT_REF_INVALID
;
...
...
@@ -1153,7 +1153,7 @@ int git_reference_lookup_resolved(
/**
* Getters
*/
git_r
type
git_reference_type
(
git_reference
*
ref
)
git_r
ef_t
git_reference_type
(
git_reference
*
ref
)
{
assert
(
ref
);
...
...
tests-clar/refs/branches/delete.c
View file @
2e2e9785
...
...
@@ -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_t
ype
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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment