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
1e808f9c
Commit
1e808f9c
authored
Nov 01, 2012
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: Add `git_index_new`
parent
43eeca04
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
0 deletions
+18
-0
include/git2/index.h
+13
-0
src/index.c
+5
-0
No files found.
include/git2/index.h
View file @
1e808f9c
...
...
@@ -126,6 +126,19 @@ enum {
GIT_EXTERN
(
int
)
git_index_open
(
git_index
**
index
,
const
char
*
index_path
);
/**
* Create an in-memory index object.
*
* This index object cannot be read/written to the filesystem,
* but may be used to perform in-memory index operations.
*
* The index must be freed once it's no longer in use.
*
* @param index the pointer for the new index
* @return 0 or an error code
*/
GIT_EXTERN
(
int
)
git_index_new
(
git_index
**
index
);
/**
* Free an existing index object.
*
* @param index an existing index object
...
...
src/index.c
View file @
1e808f9c
...
...
@@ -287,6 +287,11 @@ int git_index_open(git_index **index_out, const char *index_path)
return
(
index_path
!=
NULL
)
?
git_index_read
(
index
)
:
0
;
}
int
git_index_new
(
git_index
**
out
)
{
return
git_index_open
(
out
,
NULL
);
}
static
void
index_free
(
git_index
*
index
)
{
git_index_entry
*
e
;
...
...
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