diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2014-10-01 12:28:08 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-10-01 13:38:39 -0700 |
commit | 5527d5349b42aeb2ea36edfd2d55016f22fefc08 (patch) | |
tree | 9a5d552ad131f9b650f6fe796991854068dd10e8 /lockfile.c | |
parent | 419f0c0f681b76d720699977abe03d29e22db554 (diff) | |
download | git-5527d5349b42aeb2ea36edfd2d55016f22fefc08.tar.gz |
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 <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'lockfile.c')
-rw-r--r-- | lockfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |