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
63f08e42
Commit
63f08e42
authored
Aug 26, 2021
by
lhchavez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the defaultable fields defaultable
Also, add `git_commit_graph_writer_options_init`!
parent
2988f736
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
include/git2/sys/commit_graph.h
+2
-2
src/commit_graph.c
+13
-1
tests/core/structinit.c
+8
-0
No files found.
include/git2/sys/commit_graph.h
View file @
63f08e42
...
...
@@ -115,12 +115,13 @@ typedef struct {
/**
* The number of commits in level N is less than X times the number of
* commits in level N + 1.
* commits in level N + 1.
Default is 2.
*/
float
size_multiple
;
/**
* The number of commits in level N + 1 is more than C commits.
* Default is 64000.
*/
size_t
max_commits
;
}
git_commit_graph_writer_options
;
...
...
@@ -129,7 +130,6 @@ typedef struct {
#define GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT \
{ \
GIT_COMMIT_GRAPH_WRITER_OPTIONS_VERSION, \
GIT_COMMIT_GRAPH_SPLIT_STRATEGY_SINGLE_FILE, 2.0f, 64000 \
}
/**
...
...
src/commit_graph.c
View file @
63f08e42
...
...
@@ -1143,6 +1143,18 @@ static int commit_graph_write_filebuf(const char *buf, size_t size, void *data)
return
git_filebuf_write
(
f
,
buf
,
size
);
}
int
git_commit_graph_writer_options_init
(
git_commit_graph_writer_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_commit_graph_writer_options
,
GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT
);
return
0
;
}
int
git_commit_graph_writer_commit
(
git_commit_graph_writer
*
w
,
git_commit_graph_writer_options
*
opts
)
...
...
@@ -1152,7 +1164,7 @@ int git_commit_graph_writer_commit(
git_buf
commit_graph_path
=
GIT_BUF_INIT
;
git_filebuf
output
=
GIT_FILEBUF_INIT
;
/* TODO: support options. */
/* TODO: support options
and fill in defaults
. */
GIT_UNUSED
(
opts
);
error
=
git_buf_joinpath
(
...
...
tests/core/structinit.c
View file @
63f08e42
#include "clar_libgit2.h"
#include <git2/sys/commit_graph.h>
#include <git2/sys/config.h>
#include <git2/sys/filter.h>
#include <git2/sys/odb_backend.h>
...
...
@@ -97,6 +98,13 @@ void test_core_structinit__compare(void)
git_clone_options
,
GIT_CLONE_OPTIONS_VERSION
,
\
GIT_CLONE_OPTIONS_INIT
,
git_clone_options_init
);
/* commit_graph_writer */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_commit_graph_writer_options
,
\
GIT_COMMIT_GRAPH_WRITER_OPTIONS_VERSION
,
\
GIT_COMMIT_GRAPH_WRITER_OPTIONS_INIT
,
\
git_commit_graph_writer_options_init
);
/* diff */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_diff_options
,
GIT_DIFF_OPTIONS_VERSION
,
\
...
...
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