Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-07-24 20:22:41 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-07-25 00:02:11 +0300
commit19d9beb7ffbde3e171c17fc3544d508304a30fbf (patch)
tree1999c60c5fd7cb91ec7830de516896540deabde7 /tests/core
parent668053befecfd0979ff790bc9a2a3c308c38a9be (diff)
filebuf: remove lockfile upon rename errors
When we have an error renaming the lockfile, we need to make sure that we remove it upon cleanup. For this, we need to keep track of whether we opened the file and whether the rename succeeded. If we did create the lockfile but the rename did not succeed, we remove the lockfile. This won't protect against all errors, but the most common ones (target file is open) does get handled.
Diffstat (limited to 'tests/core')
-rw-r--r--tests/core/filebuf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/core/filebuf.c b/tests/core/filebuf.c
index 9fd52b179..3f7dc8569 100644
--- a/tests/core/filebuf.c
+++ b/tests/core/filebuf.c
@@ -148,6 +148,6 @@ void test_core_filebuf__rename_error(void)
p_close(fd);
git_filebuf_cleanup(&file);
- cl_assert_equal_i(false, git_path_exists(test_lock));
+ cl_assert_equal_i(false, git_path_exists(test_lock));
}