path: root/pack-refs.c
diff options
authorAlex Riesen <>2009-04-29 21:22:56 (GMT)
committerJunio C Hamano <>2009-04-30 01:37:41 (GMT)
commit691f1a28bf57618d8b44a193b1d28013c858aba6 (patch)
tree7d404656089320d486f658d3f4c061cd13dff556 /pack-refs.c
parentfc71db39e0d75e8a403f36f3fecf4450886cd165 (diff)
replace direct calls to unlink(2) with unlink_or_warn
This helps to notice when something's going wrong, especially on systems which lock open files. I used the following criteria when selecting the code for replacement: - it was already printing a warning for the unlink failures - it is in a function which already printing something or is called from such a function - it is in a static function, returning void and the function is only called from a builtin main function (cmd_) - it is in a function which handles emergency exit (signal handlers) - it is in a function which is obvously cleaning up the lockfiles Signed-off-by: Alex Riesen <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'pack-refs.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/pack-refs.c b/pack-refs.c
index 2c76fb1..301fc60 100644
--- a/pack-refs.c
+++ b/pack-refs.c
@@ -66,7 +66,7 @@ static void prune_ref(struct ref_to_prune *r)
struct ref_lock *lock = lock_ref_sha1(r->name + 5, r->sha1);
if (lock) {
- unlink(git_path("%s", r->name));
+ unlink_or_warn(git_path("%s", r->name));