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
0774d94d
Commit
0774d94d
authored
Feb 01, 2012
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store multivars in the multimap
parent
fefd4551
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/config_file.c
+11
-3
No files found.
src/config_file.c
View file @
0774d94d
...
@@ -720,7 +720,7 @@ static int config_parse(diskfile_backend *cfg_file)
...
@@ -720,7 +720,7 @@ static int config_parse(diskfile_backend *cfg_file)
char
*
current_section
=
NULL
;
char
*
current_section
=
NULL
;
char
*
var_name
;
char
*
var_name
;
char
*
var_value
;
char
*
var_value
;
cvar_t
*
var
;
cvar_t
*
var
,
*
existing
;
git_buf
buf
=
GIT_BUF_INIT
;
git_buf
buf
=
GIT_BUF_INIT
;
/* Initialize the reading position */
/* Initialize the reading position */
...
@@ -779,8 +779,16 @@ static int config_parse(diskfile_backend *cfg_file)
...
@@ -779,8 +779,16 @@ static int config_parse(diskfile_backend *cfg_file)
var
->
key
=
git_buf_detach
(
&
buf
);
var
->
key
=
git_buf_detach
(
&
buf
);
var
->
value
=
var_value
;
var
->
value
=
var_value
;
/* FIXME: Actually support multivars, don't just overwrite */
/* Add or append the new config option */
error
=
git_hashtable_insert
(
cfg_file
->
values
,
var
->
key
,
var
);
existing
=
git_hashtable_lookup
(
cfg_file
->
values
,
var
->
key
);
if
(
existing
==
NULL
)
{
error
=
git_hashtable_insert
(
cfg_file
->
values
,
var
->
key
,
var
);
}
else
{
while
(
existing
->
next
!=
NULL
)
{
existing
=
existing
->
next
;
}
existing
->
next
=
var
;
}
break
;
break
;
}
}
...
...
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