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
3a42e0a3
Commit
3a42e0a3
authored
Jun 03, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: Add `git_index_entry_stage` method
As suggested by Romain-Geissler
parent
0291b5b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
include/git2/index.h
+12
-0
src/index.c
+5
-0
No files found.
include/git2/index.h
View file @
3a42e0a3
...
...
@@ -287,6 +287,18 @@ GIT_EXTERN(unsigned int) git_index_entrycount_unmerged(git_index *index);
*/
GIT_EXTERN
(
const
git_index_entry_unmerged
*
)
git_index_get_unmerged
(
git_index
*
index
,
const
char
*
path
);
/**
* Return the stage number from a git index entry
*
* This entry is calculated from the entrie's flag
* attribute like this:
*
* (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT
*
* @param entry The entry
* @returns the stage number
*/
GIT_EXTERN
(
int
)
git_index_entry_stage
(
const
git_index_entry
*
entry
);
/** @} */
GIT_END_DECL
...
...
src/index.c
View file @
3a42e0a3
...
...
@@ -980,3 +980,8 @@ static int write_index(git_index *index, git_filebuf *file)
return
error
==
GIT_SUCCESS
?
GIT_SUCCESS
:
git__rethrow
(
error
,
"Failed to write index"
);
}
int
git_index_entry_stage
(
const
git_index_entry
*
entry
)
{
return
(
entry
->
flags
&
GIT_IDXENTRY_STAGEMASK
)
>>
GIT_IDXENTRY_STAGESHIFT
;
}
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