git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sequencer: remove pointless rollback_lock_file()
@ 2023-03-23 16:22 Oswald Buddenhagen
  2023-03-24 14:51 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Oswald Buddenhagen @ 2023-03-23 16:22 UTC (permalink / raw)
  To: git

The file is gone even if commit_lock_file() fails.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
---
 sequencer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index 3be23d7ca2..2da9b9f890 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3676,7 +3676,6 @@ static int safe_append(const char *filename, const char *fmt, ...)
 	}
 	if (commit_lock_file(&lock) < 0) {
 		strbuf_release(&buf);
-		rollback_lock_file(&lock);
 		return error(_("failed to finalize '%s'"), filename);
 	}
 
-- 
2.40.0.152.g15d061e6df


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sequencer: remove pointless rollback_lock_file()
  2023-03-23 16:22 [PATCH] sequencer: remove pointless rollback_lock_file() Oswald Buddenhagen
@ 2023-03-24 14:51 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2023-03-24 14:51 UTC (permalink / raw)
  To: Oswald Buddenhagen; +Cc: git

Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:

> The file is gone even if commit_lock_file() fails.

Good spotting.  

I glanced over hits from "git grep -A6 commit_lock_file \*.c" to see
if there is a similar mistake, but this seems to be the only one.

Will queue.  Thanks.

> Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
> ---
>  sequencer.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 3be23d7ca2..2da9b9f890 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -3676,7 +3676,6 @@ static int safe_append(const char *filename, const char *fmt, ...)
>  	}
>  	if (commit_lock_file(&lock) < 0) {
>  		strbuf_release(&buf);
> -		rollback_lock_file(&lock);
>  		return error(_("failed to finalize '%s'"), filename);
>  	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-24 14:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-23 16:22 [PATCH] sequencer: remove pointless rollback_lock_file() Oswald Buddenhagen
2023-03-24 14:51 ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).