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
388f37b3
Commit
388f37b3
authored
Jun 14, 2011
by
Scott Chacon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add examples for docs
parent
742e3fc9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
api.docurium
+2
-0
examples/libgit.c
+0
-0
examples/showindex.c
+43
-0
No files found.
api.docurium
View file @
388f37b3
...
...
@@ -4,6 +4,8 @@
"input": "include/git2",
"prefix": "git_",
"output": "docs",
"branch": "gh-pages",
"examples": "examples",
"legacy": {
"input": {"src/git": ["v0.1.0"],
"src/git2": ["v0.2.0", "v0.3.0"]}
...
...
examples/libgit.c
0 → 100644
View file @
388f37b3
This diff is collapsed.
Click to expand it.
examples/showindex.c
0 → 100644
View file @
388f37b3
#include <git2.h>
#include <stdio.h>
int
main
(
int
argc
,
char
**
argv
)
{
git_repository
*
repo
;
git_index
*
index
;
unsigned
int
i
,
e
,
ecount
;
git_index_entry
**
entries
;
git_oid
oid
;
char
out
[
41
];
out
[
40
]
=
'\0'
;
git_repository_open
(
&
repo
,
"/tmp/gittalk/.git"
);
git_index_open_inrepo
(
&
index
,
repo
);
git_index_read
(
index
);
ecount
=
git_index_entrycount
(
index
);
for
(
i
=
0
;
i
<
ecount
;
++
i
)
{
git_index_entry
*
e
=
git_index_get
(
index
,
i
);
oid
=
e
->
oid
;
git_oid_fmt
(
out
,
&
oid
);
printf
(
"File Path: %s
\n
"
,
e
->
path
);
printf
(
" Blob SHA: %s
\n
"
,
out
);
printf
(
"File Size: %d
\n
"
,
(
int
)
e
->
file_size
);
printf
(
" Device: %d
\n
"
,
(
int
)
e
->
dev
);
printf
(
" Inode: %d
\n
"
,
(
int
)
e
->
ino
);
printf
(
" UID: %d
\n
"
,
(
int
)
e
->
uid
);
printf
(
" GID: %d
\n
"
,
(
int
)
e
->
gid
);
printf
(
" ctime: %d
\n
"
,
(
int
)
e
->
ctime
.
seconds
);
printf
(
" mtime: %d
\n
"
,
(
int
)
e
->
mtime
.
seconds
);
printf
(
"
\n
"
);
}
git_index_free
(
index
);
git_repository_free
(
repo
);
}
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