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
1071c565
Commit
1071c565
authored
Jun 08, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #246 from carlosmn/keep-lock
Keep the lockfile if we fail to lock it
parents
3a12891f
bb9272dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
+13
-1
src/filebuf.c
+1
-1
tests/t00-core.c
+12
-0
No files found.
src/filebuf.c
View file @
1071c565
...
...
@@ -75,7 +75,7 @@ void git_filebuf_cleanup(git_filebuf *file)
if
(
file
->
fd
>=
0
)
gitfo_close
(
file
->
fd
);
if
(
file
->
path_lock
&&
gitfo_exists
(
file
->
path_lock
)
==
GIT_SUCCESS
)
if
(
file
->
fd
>=
0
&&
file
->
path_lock
&&
gitfo_exists
(
file
->
path_lock
)
==
GIT_SUCCESS
)
gitfo_unlink
(
file
->
path_lock
);
if
(
file
->
digest
)
...
...
tests/t00-core.c
View file @
1071c565
...
...
@@ -26,6 +26,7 @@
#include "vector.h"
#include "fileops.h"
#include "filebuf.h"
BEGIN_TEST
(
string0
,
"compare prefixes"
)
must_be_true
(
git__prefixcmp
(
""
,
""
)
==
0
);
...
...
@@ -661,6 +662,15 @@ BEGIN_TEST(dirent4, "make sure that strange looking filenames ('..c') are traver
must_pass
(
knockdown
(
&
odd
));
END_TEST
BEGIN_TEST
(
filebuf0
,
"make sure git_filebuf_open doesn't delete an existing lock"
)
git_filebuf
file
;
char
test
[]
=
"test"
,
testlock
[]
=
"test.lock"
;
must_pass
(
gitfo_creat
(
testlock
,
0744
));
must_fail
(
git_filebuf_open
(
&
file
,
test
,
0
));
must_pass
(
gitfo_exists
(
testlock
));
must_pass
(
gitfo_unlink
(
testlock
));
END_TEST
BEGIN_SUITE
(
core
)
ADD_TEST
(
string0
);
...
...
@@ -683,4 +693,6 @@ BEGIN_SUITE(core)
ADD_TEST
(
dirent2
);
ADD_TEST
(
dirent3
);
ADD_TEST
(
dirent4
);
ADD_TEST
(
filebuf0
);
END_SUITE
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