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
f5586f5c
Commit
f5586f5c
authored
Jan 14, 2017
by
lhchavez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressed review feedback
parent
96df833b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
src/indexer.c
+5
-5
tests/pack/indexer.c
+3
-10
No files found.
src/indexer.c
View file @
f5586f5c
...
...
@@ -151,11 +151,11 @@ cleanup:
if
(
fd
!=
-
1
)
p_close
(
fd
);
if
(
git_buf_
is_allocated
(
&
tmp_path
)
)
(
void
)
p_unlink
(
git_buf_cstr
(
&
tmp_path
));
if
(
git_buf_
len
(
&
tmp_path
)
>
0
)
p_unlink
(
git_buf_cstr
(
&
tmp_path
));
if
(
idx
->
pack
!=
NULL
)
(
void
)
p_unlink
(
idx
->
pack
->
pack_name
);
p_unlink
(
idx
->
pack
->
pack_name
);
git_buf_free
(
&
path
);
git_buf_free
(
&
tmp_path
);
...
...
@@ -1094,10 +1094,10 @@ void git_indexer_free(git_indexer *idx)
git_mwindow_free_all
(
&
idx
->
pack
->
mwf
);
/* We need to close the descriptor here so Windows doesn't choke on unlink */
if
(
idx
->
pack
->
mwf
.
fd
!=
-
1
)
{
(
void
)
p_close
(
idx
->
pack
->
mwf
.
fd
);
p_close
(
idx
->
pack
->
mwf
.
fd
);
idx
->
pack
->
mwf
.
fd
=
-
1
;
}
(
void
)
p_unlink
(
idx
->
pack
->
pack_name
);
p_unlink
(
idx
->
pack
->
pack_name
);
if
(
!
git_mutex_lock
(
&
git__mwindow_mutex
))
{
git_packfile_free
(
idx
->
pack
);
...
...
tests/pack/indexer.c
View file @
f5586f5c
...
...
@@ -155,11 +155,7 @@ void test_pack_indexer__no_tmp_files(void)
cl_git_pass
(
git_buf_sets
(
&
path
,
clar_sandbox_path
()));
cl_git_pass
(
find_tmp_file_recurs
(
&
first_tmp_file
,
&
path
));
git_buf_free
(
&
path
);
if
(
git_buf_is_allocated
(
&
first_tmp_file
))
{
git_buf_free
(
&
first_tmp_file
);
cl_warning
(
"Found a temporary file before running the test"
);
cl_skip
();
}
cl_assert
(
git_buf_len
(
&
first_tmp_file
)
==
0
);
cl_git_pass
(
git_indexer_new
(
&
idx
,
"."
,
0
,
NULL
,
NULL
,
NULL
));
git_indexer_free
(
idx
);
...
...
@@ -167,9 +163,6 @@ void test_pack_indexer__no_tmp_files(void)
cl_git_pass
(
git_buf_sets
(
&
path
,
clar_sandbox_path
()));
cl_git_pass
(
find_tmp_file_recurs
(
&
first_tmp_file
,
&
path
));
git_buf_free
(
&
path
);
if
(
git_buf_is_allocated
(
&
first_tmp_file
))
{
cl_warning
(
git_buf_cstr
(
&
first_tmp_file
));
git_buf_free
(
&
first_tmp_file
);
cl_fail
(
"Found a temporary file"
);
}
cl_assert
(
git_buf_len
(
&
first_tmp_file
)
==
0
);
git_buf_free
(
&
first_tmp_file
);
}
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