From 5527d5349b42aeb2ea36edfd2d55016f22fefc08 Mon Sep 17 00:00:00 2001 From: Michael Haggerty Date: Wed, 1 Oct 2014 12:28:08 +0200 Subject: rollback_lock_file(): do not clear filename redundantly It is only necessary to clear the lock_file's filename field if it was not already clear. Signed-off-by: Michael Haggerty Reviewed-by: Ronnie Sahlberg Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano --- lockfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lockfile.c b/lockfile.c index d02c3bf901..5330d6ae52 100644 --- a/lockfile.c +++ b/lockfile.c @@ -280,6 +280,6 @@ void rollback_lock_file(struct lock_file *lk) if (lk->fd >= 0) close(lk->fd); unlink_or_warn(lk->filename); + lk->filename[0] = 0; } - lk->filename[0] = 0; } -- cgit v1.2.3