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
50eb7d31
Unverified
Commit
50eb7d31
authored
Jan 20, 2022
by
Edward Thomson
Committed by
GitHub
Jan 20, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6184 from boretrk/noflexarray
diff_driver: split global_drivers array into separate elements
parents
4fead636
5388e0c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
9 deletions
+7
-9
src/diff_driver.c
+7
-9
No files found.
src/diff_driver.c
View file @
50eb7d31
...
@@ -51,11 +51,9 @@ struct git_diff_driver_registry {
...
@@ -51,11 +51,9 @@ struct git_diff_driver_registry {
#define FORCE_DIFFABLE (GIT_DIFF_FORCE_TEXT | GIT_DIFF_FORCE_BINARY)
#define FORCE_DIFFABLE (GIT_DIFF_FORCE_TEXT | GIT_DIFF_FORCE_BINARY)
static
git_diff_driver
global_drivers
[
3
]
=
{
static
git_diff_driver
diff_driver_auto
=
{
DIFF_DRIVER_AUTO
,
0
,
0
};
{
DIFF_DRIVER_AUTO
,
0
,
0
,
},
static
git_diff_driver
diff_driver_binary
=
{
DIFF_DRIVER_BINARY
,
GIT_DIFF_FORCE_BINARY
,
0
};
{
DIFF_DRIVER_BINARY
,
GIT_DIFF_FORCE_BINARY
,
0
},
static
git_diff_driver
diff_driver_text
=
{
DIFF_DRIVER_TEXT
,
GIT_DIFF_FORCE_TEXT
,
0
};
{
DIFF_DRIVER_TEXT
,
GIT_DIFF_FORCE_TEXT
,
0
},
};
git_diff_driver_registry
*
git_diff_driver_registry_new
(
void
)
git_diff_driver_registry
*
git_diff_driver_registry_new
(
void
)
{
{
...
@@ -266,7 +264,7 @@ static int git_diff_driver_load(
...
@@ -266,7 +264,7 @@ static int git_diff_driver_load(
switch
(
git_config__get_bool_force
(
cfg
,
name
.
ptr
,
-
1
))
{
switch
(
git_config__get_bool_force
(
cfg
,
name
.
ptr
,
-
1
))
{
case
true
:
case
true
:
/* if diff.<driver>.binary is true, just return the binary driver */
/* if diff.<driver>.binary is true, just return the binary driver */
*
out
=
&
global_drivers
[
DIFF_DRIVER_BINARY
]
;
*
out
=
&
diff_driver_binary
;
goto
done
;
goto
done
;
case
false
:
case
false
:
/* if diff.<driver>.binary is false, force binary checks off */
/* if diff.<driver>.binary is false, force binary checks off */
...
@@ -374,9 +372,9 @@ int git_diff_driver_lookup(
...
@@ -374,9 +372,9 @@ int git_diff_driver_lookup(
else
if
(
GIT_ATTR_IS_UNSPECIFIED
(
values
[
0
]))
else
if
(
GIT_ATTR_IS_UNSPECIFIED
(
values
[
0
]))
/* just use the auto value */
;
/* just use the auto value */
;
else
if
(
GIT_ATTR_IS_FALSE
(
values
[
0
]))
else
if
(
GIT_ATTR_IS_FALSE
(
values
[
0
]))
*
out
=
&
global_drivers
[
DIFF_DRIVER_BINARY
]
;
*
out
=
&
diff_driver_binary
;
else
if
(
GIT_ATTR_IS_TRUE
(
values
[
0
]))
else
if
(
GIT_ATTR_IS_TRUE
(
values
[
0
]))
*
out
=
&
global_drivers
[
DIFF_DRIVER_TEXT
]
;
*
out
=
&
diff_driver_text
;
/* otherwise look for driver information in config and build driver */
/* otherwise look for driver information in config and build driver */
else
if
((
error
=
git_diff_driver_load
(
out
,
repo
,
values
[
0
]))
<
0
)
{
else
if
((
error
=
git_diff_driver_load
(
out
,
repo
,
values
[
0
]))
<
0
)
{
...
@@ -387,7 +385,7 @@ int git_diff_driver_lookup(
...
@@ -387,7 +385,7 @@ int git_diff_driver_lookup(
}
}
if
(
!*
out
)
if
(
!*
out
)
*
out
=
&
global_drivers
[
DIFF_DRIVER_AUTO
]
;
*
out
=
&
diff_driver_auto
;
return
error
;
return
error
;
}
}
...
...
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