diff mbox series

sequencer: remove pointless rollback_lock_file()

Message ID 20230323162235.995529-1-oswald.buddenhagen@gmx.de (mailing list archive)
State Accepted
Commit 2da2cc9b28fb6c4ac1eb3c7487c4fd817ba20dba
Headers show
Series sequencer: remove pointless rollback_lock_file() | expand

Commit Message

Oswald Buddenhagen March 23, 2023, 4:22 p.m. UTC
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(-)

Comments

Junio C Hamano March 24, 2023, 2:51 p.m. UTC | #1
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);
>  	}
diff mbox series

Patch

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);
 	}