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
b99b10f2
Commit
b99b10f2
authored
Sep 17, 2013
by
Linquize
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Can git_libgit2_opts() with GIT_OPT_GET_TEMPLATE_PATH and GIT_OPT_SET_TEMPLATE_PATH
parent
7e8934bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletions
+28
-1
include/git2/common.h
+15
-1
src/util.c
+13
-0
No files found.
include/git2/common.h
View file @
b99b10f2
...
...
@@ -136,7 +136,9 @@ typedef enum {
GIT_OPT_SET_CACHE_OBJECT_LIMIT
,
GIT_OPT_SET_CACHE_MAX_SIZE
,
GIT_OPT_ENABLE_CACHING
,
GIT_OPT_GET_CACHED_MEMORY
GIT_OPT_GET_CACHED_MEMORY
,
GIT_OPT_GET_TEMPLATE_PATH
,
GIT_OPT_SET_TEMPLATE_PATH
}
git_libgit2_opt_t
;
/**
...
...
@@ -210,6 +212,18 @@ typedef enum {
* > Get the current bytes in cache and the maximum that would be
* > allowed in the cache.
*
* * opts(GIT_OPT_GET_SEARCH_PATH, char *out, size_t len)
*
* > Get the default template path.
* > The path is written to the `out`
* > buffer up to size `len`. Returns GIT_EBUFS if buffer is too small.
*
* * opts(GIT_OPT_SET_TEMPLATE_PATH, const char *path)
*
* > Set the default template path.
* >
* > - `path` directory of template.
*
* @param option Option key
* @param ... value to set the option
* @return 0 on success, <0 on failure
...
...
src/util.c
View file @
b99b10f2
...
...
@@ -117,6 +117,19 @@ int git_libgit2_opts(int key, ...)
*
(
va_arg
(
ap
,
ssize_t
*
))
=
git_cache__current_storage
.
val
;
*
(
va_arg
(
ap
,
ssize_t
*
))
=
git_cache__max_storage
;
break
;
case
GIT_OPT_GET_TEMPLATE_PATH
:
{
char
*
out
=
va_arg
(
ap
,
char
*
);
size_t
outlen
=
va_arg
(
ap
,
size_t
);
error
=
git_futils_dirs_get_str
(
out
,
outlen
,
GIT_FUTILS_DIR_TEMPLATE
);
}
break
;
case
GIT_OPT_SET_TEMPLATE_PATH
:
error
=
git_futils_dirs_set
(
GIT_FUTILS_DIR_TEMPLATE
,
va_arg
(
ap
,
const
char
*
));
break
;
}
va_end
(
ap
);
...
...
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