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
2414d000
Commit
2414d000
authored
Jun 17, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #266 from carlosmn/valgrind
Plug memory leaks
parents
02285482
3d5a02b6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletions
+14
-1
src/config_file.c
+11
-1
tests/t06-index.c
+1
-0
tests/t12-repo.c
+2
-0
No files found.
src/config_file.c
View file @
2414d000
...
@@ -986,10 +986,19 @@ static int config_write(diskfile_backend *cfg, cvar_t *var)
...
@@ -986,10 +986,19 @@ static int config_write(diskfile_backend *cfg, cvar_t *var)
break
;
break
;
}
}
}
else
{
}
else
{
int
cmp
;
pre_end
=
cfg
->
reader
.
read_ptr
;
pre_end
=
cfg
->
reader
.
read_ptr
;
error
=
parse_variable
(
cfg
,
&
var_name
,
&
var_value
);
error
=
parse_variable
(
cfg
,
&
var_name
,
&
var_value
);
if
(
error
<
GIT_SUCCESS
||
strcasecmp
(
var
->
name
,
var_name
))
if
(
error
==
GIT_SUCCESS
)
cmp
=
strcasecmp
(
var
->
name
,
var_name
);
free
(
var_name
);
free
(
var_value
);
if
(
error
<
GIT_SUCCESS
||
cmp
)
break
;
break
;
post_start
=
cfg
->
reader
.
read_ptr
;
post_start
=
cfg
->
reader
.
read_ptr
;
}
}
...
@@ -1060,6 +1069,7 @@ static int config_write(diskfile_backend *cfg, cvar_t *var)
...
@@ -1060,6 +1069,7 @@ static int config_write(diskfile_backend *cfg, cvar_t *var)
else
else
error
=
git_filebuf_commit
(
&
file
);
error
=
git_filebuf_commit
(
&
file
);
gitfo_free_buf
(
&
cfg
->
reader
.
buffer
);
return
error
;
return
error
;
}
}
...
...
tests/t06-index.c
View file @
2414d000
...
@@ -208,6 +208,7 @@ BEGIN_TEST(add0, "add a new file to the index")
...
@@ -208,6 +208,7 @@ BEGIN_TEST(add0, "add a new file to the index")
/* And the built-in hashing mechanism worked as expected */
/* And the built-in hashing mechanism worked as expected */
must_be_true
(
git_oid_cmp
(
&
id1
,
&
entry
->
oid
)
==
0
);
must_be_true
(
git_oid_cmp
(
&
id1
,
&
entry
->
oid
)
==
0
);
git_index_free
(
index
);
git_repository_free
(
repo
);
git_repository_free
(
repo
);
rmdir_recurs
(
TEMP_REPO_FOLDER
);
rmdir_recurs
(
TEMP_REPO_FOLDER
);
END_TEST
END_TEST
...
...
tests/t12-repo.c
View file @
2414d000
...
@@ -355,6 +355,7 @@ BEGIN_TEST(discover0, "test discover")
...
@@ -355,6 +355,7 @@ BEGIN_TEST(discover0, "test discover")
must_pass
(
git_repository_init
(
&
repo
,
DISCOVER_FOLDER
,
1
));
must_pass
(
git_repository_init
(
&
repo
,
DISCOVER_FOLDER
,
1
));
must_pass
(
git_repository_discover
(
repository_path
,
sizeof
(
repository_path
),
DISCOVER_FOLDER
,
0
,
ceiling_dirs
));
must_pass
(
git_repository_discover
(
repository_path
,
sizeof
(
repository_path
),
DISCOVER_FOLDER
,
0
,
ceiling_dirs
));
git_repository_free
(
repo
);
must_pass
(
git_repository_init
(
&
repo
,
SUB_REPOSITORY_FOLDER
,
0
));
must_pass
(
git_repository_init
(
&
repo
,
SUB_REPOSITORY_FOLDER
,
0
));
must_pass
(
gitfo_mkdir_recurs
(
SUB_REPOSITORY_FOLDER_SUB_SUB_SUB
,
mode
));
must_pass
(
gitfo_mkdir_recurs
(
SUB_REPOSITORY_FOLDER_SUB_SUB_SUB
,
mode
));
...
@@ -402,6 +403,7 @@ BEGIN_TEST(discover0, "test discover")
...
@@ -402,6 +403,7 @@ BEGIN_TEST(discover0, "test discover")
must_pass
(
ensure_repository_discover
(
REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB
,
ceiling_dirs
,
repository_path
));
must_pass
(
ensure_repository_discover
(
REPOSITORY_ALTERNATE_FOLDER_SUB_SUB_SUB
,
ceiling_dirs
,
repository_path
));
rmdir_recurs
(
DISCOVER_FOLDER
);
rmdir_recurs
(
DISCOVER_FOLDER
);
git_repository_free
(
repo
);
END_TEST
END_TEST
BEGIN_SUITE
(
repository
)
BEGIN_SUITE
(
repository
)
...
...
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