From: Michael Haggerty Date: Wed, 1 Oct 2014 10:28:08 +0000 (+0200) Subject: rollback_lock_file(): do not clear filename redundantly X-Git-Tag: v2.2.0-rc0~53^2~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5527d5349b42aeb2ea36edfd2d55016f22fefc08;p=thirdparty%2Fgit.git 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 --- 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; }