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
8e8b6b01
Commit
8e8b6b01
authored
Apr 04, 2012
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up valgrind warnings
parent
2ec83ff0
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
8 deletions
+15
-8
src/config_file.c
+1
-0
src/odb_loose.c
+1
-1
src/status.c
+2
-0
src/submodule.c
+2
-1
tests-clar/refs/unicode.c
+7
-6
tests-clar/status/submodules.c
+1
-0
tests-clar/status/worktree.c
+1
-0
No files found.
src/config_file.c
View file @
8e8b6b01
...
...
@@ -334,6 +334,7 @@ static int config_get_multivar(
var
=
var
->
next
;
}
while
(
var
!=
NULL
);
regfree
(
&
regex
);
}
else
{
/* no regex; go through all the variables */
do
{
...
...
src/odb_loose.c
View file @
8e8b6b01
...
...
@@ -772,7 +772,7 @@ static int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_
static
int
loose_backend__write
(
git_oid
*
oid
,
git_odb_backend
*
_backend
,
const
void
*
data
,
size_t
len
,
git_otype
type
)
{
int
error
,
header_len
;
int
error
=
0
,
header_len
;
git_buf
final_path
=
GIT_BUF_INIT
;
char
header
[
64
];
git_filebuf
fbuf
=
GIT_FILEBUF_INIT
;
...
...
src/status.c
View file @
8e8b6b01
...
...
@@ -43,6 +43,8 @@ static int resolve_head_to_tree(git_tree **tree, git_repository *repo)
if
(
git_object_lookup
(
&
obj
,
repo
,
git_reference_oid
(
head
),
GIT_OBJ_ANY
)
<
0
)
goto
fail
;
git_reference_free
(
head
);
switch
(
git_object_type
(
obj
))
{
case
GIT_OBJ_TREE
:
*
tree
=
(
git_tree
*
)
obj
;
...
...
src/submodule.c
View file @
8e8b6b01
...
...
@@ -182,6 +182,7 @@ static int submodule_from_config(
goto
fail
;
sm
->
refcount
++
;
}
git_buf_free
(
&
name
);
if
(
old_sm
&&
((
git_submodule
*
)
old_sm
)
!=
sm
)
{
/* TODO: log entry about multiple submodules with same path */
...
...
@@ -255,7 +256,7 @@ static int load_submodule_config(git_repository *repo)
GITERR_CHECK_ALLOC
(
smcfg
);
/* scan index for gitmodules (and .gitmodules entry) */
if
((
error
=
git_repository_index
(
&
index
,
repo
))
<
0
)
if
((
error
=
git_repository_index
__weakptr
(
&
index
,
repo
))
<
0
)
goto
cleanup
;
memset
(
&
gitmodules_oid
,
0
,
sizeof
(
gitmodules_oid
));
max_i
=
git_index_entrycount
(
index
);
...
...
tests-clar/refs/unicode.c
View file @
8e8b6b01
...
...
@@ -17,25 +17,26 @@ void test_refs_unicode__cleanup(void)
void
test_refs_unicode__create_and_lookup
(
void
)
{
git_reference
*
ref
,
*
ref2
;
git_reference
*
ref
0
,
*
ref1
,
*
ref2
;
git_repository
*
repo2
;
const
char
*
REFNAME
=
"refs/heads/"
"
\305
"
"ngstr"
"
\366
"
"m"
;
const
char
*
master
=
"refs/heads/master"
;
/* Create the reference */
cl_git_pass
(
git_reference_lookup
(
&
ref
,
repo
,
master
));
cl_git_pass
(
git_reference_create_oid
(
&
ref
,
repo
,
REFNAME
,
git_reference_oid
(
ref
),
0
));
cl_assert
(
strcmp
(
REFNAME
,
git_reference_name
(
ref
))
==
0
);
cl_git_pass
(
git_reference_lookup
(
&
ref
0
,
repo
,
master
));
cl_git_pass
(
git_reference_create_oid
(
&
ref
1
,
repo
,
REFNAME
,
git_reference_oid
(
ref0
),
0
));
cl_assert
(
strcmp
(
REFNAME
,
git_reference_name
(
ref
1
))
==
0
);
/* Lookup the reference in a different instance of the repository */
cl_git_pass
(
git_repository_open
(
&
repo2
,
"testrepo.git"
));
cl_git_pass
(
git_reference_lookup
(
&
ref2
,
repo2
,
REFNAME
));
cl_assert
(
git_oid_cmp
(
git_reference_oid
(
ref
),
git_reference_oid
(
ref2
))
==
0
);
cl_assert
(
git_oid_cmp
(
git_reference_oid
(
ref
1
),
git_reference_oid
(
ref2
))
==
0
);
cl_assert
(
strcmp
(
REFNAME
,
git_reference_name
(
ref2
))
==
0
);
git_reference_free
(
ref
);
git_reference_free
(
ref0
);
git_reference_free
(
ref1
);
git_reference_free
(
ref2
);
git_repository_free
(
repo2
);
}
tests-clar/status/submodules.c
View file @
8e8b6b01
...
...
@@ -19,6 +19,7 @@ void test_status_submodules__initialize(void)
p_rename
(
"submodules/gitmodules"
,
"submodules/.gitmodules"
);
cl_git_append2file
(
"submodules/.gitmodules"
,
modpath
.
ptr
);
git_buf_free
(
&
modpath
);
p_rename
(
"submodules/testrepo/.gitted"
,
"submodules/testrepo/.git"
);
}
...
...
tests-clar/status/worktree.c
View file @
8e8b6b01
...
...
@@ -127,6 +127,7 @@ void test_status_worktree__purged_worktree(void)
/* first purge the contents of the worktree */
cl_git_pass
(
git_buf_sets
(
&
workdir
,
git_repository_workdir
(
repo
)));
cl_git_pass
(
git_path_direach
(
&
workdir
,
remove_file_cb
,
NULL
));
git_buf_free
(
&
workdir
);
/* now get status */
memset
(
&
counts
,
0x0
,
sizeof
(
struct
status_entry_counts
));
...
...
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