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
01be7863
Commit
01be7863
authored
Mar 01, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1382 from arrbee/fix-diff-patch-a-different-way
Allow empty config object and use it for tests
parents
47f70846
487fc724
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
12 deletions
+4
-12
src/config.c
+0
-6
tests-clar/diff/patch.c
+4
-6
No files found.
src/config.c
View file @
01be7863
...
@@ -426,8 +426,6 @@ static int get_string(const char **out, const git_config *cfg, const char *name)
...
@@ -426,8 +426,6 @@ static int get_string(const char **out, const git_config *cfg, const char *name)
file_internal
*
internal
;
file_internal
*
internal
;
unsigned
int
i
;
unsigned
int
i
;
assert
(
cfg
->
files
.
length
);
git_vector_foreach
(
&
cfg
->
files
,
i
,
internal
)
{
git_vector_foreach
(
&
cfg
->
files
,
i
,
internal
)
{
int
res
=
get_string_at_file
(
out
,
internal
->
file
,
name
);
int
res
=
get_string_at_file
(
out
,
internal
->
file
,
name
);
...
@@ -466,8 +464,6 @@ int git_config_get_entry(const git_config_entry **out, const git_config *cfg, co
...
@@ -466,8 +464,6 @@ int git_config_get_entry(const git_config_entry **out, const git_config *cfg, co
file_internal
*
internal
;
file_internal
*
internal
;
unsigned
int
i
;
unsigned
int
i
;
assert
(
cfg
->
files
.
length
);
*
out
=
NULL
;
*
out
=
NULL
;
git_vector_foreach
(
&
cfg
->
files
,
i
,
internal
)
{
git_vector_foreach
(
&
cfg
->
files
,
i
,
internal
)
{
...
@@ -488,8 +484,6 @@ int git_config_get_multivar(const git_config *cfg, const char *name, const char
...
@@ -488,8 +484,6 @@ int git_config_get_multivar(const git_config *cfg, const char *name, const char
int
ret
=
GIT_ENOTFOUND
;
int
ret
=
GIT_ENOTFOUND
;
size_t
i
;
size_t
i
;
assert
(
cfg
->
files
.
length
);
/*
/*
* This loop runs the "wrong" way 'round because we need to
* This loop runs the "wrong" way 'round because we need to
* look at every value from the most general to most specific
* look at every value from the most general to most specific
...
...
tests-clar/diff/patch.c
View file @
01be7863
...
@@ -150,9 +150,8 @@ void test_diff_patch__hunks_have_correct_line_numbers(void)
...
@@ -150,9 +150,8 @@ void test_diff_patch__hunks_have_correct_line_numbers(void)
g_repo
=
cl_git_sandbox_init
(
"renames"
);
g_repo
=
cl_git_sandbox_init
(
"renames"
);
cl_git_pass
(
git_repository_config
(
&
cfg
,
g_repo
));
cl_git_pass
(
git_config_new
(
&
cfg
));
cl_git_pass
(
git_config_set_bool
(
cfg
,
"core.autocrlf"
,
false
));
git_repository_set_config
(
g_repo
,
cfg
);
git_config_free
(
cfg
);
cl_git_rewritefile
(
"renames/songof7cities.txt"
,
new_content
);
cl_git_rewritefile
(
"renames/songof7cities.txt"
,
new_content
);
...
@@ -278,9 +277,8 @@ void test_diff_patch__line_counts_with_eofnl(void)
...
@@ -278,9 +277,8 @@ void test_diff_patch__line_counts_with_eofnl(void)
g_repo
=
cl_git_sandbox_init
(
"renames"
);
g_repo
=
cl_git_sandbox_init
(
"renames"
);
cl_git_pass
(
git_repository_config
(
&
cfg
,
g_repo
));
cl_git_pass
(
git_config_new
(
&
cfg
));
cl_git_pass
(
git_config_set_bool
(
cfg
,
"core.autocrlf"
,
false
));
git_repository_set_config
(
g_repo
,
cfg
);
git_config_free
(
cfg
);
cl_git_pass
(
git_futils_readbuffer
(
&
content
,
"renames/songof7cities.txt"
));
cl_git_pass
(
git_futils_readbuffer
(
&
content
,
"renames/songof7cities.txt"
));
...
...
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