Skip to contentSkip to conversation

sequencer: remove pointless rollback_lock_file()

PATCH In review Oswald Buddenhagen 2 participants 2 messages Mar 23, 2023 – Mar 24, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sequencer: remove pointless rollback_lock_file()

The file is gone even if commit_lock_file() fails.

---
 sequencer.c | 1 -
 1 file changed, 1 deletion(-)
sequencer.c +0 -1
index 3be23d7ca2..2da9b9f890 100644
@@ -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);
 	}
 
Signature · 1 line
2.40.0.152.g15d061e6df
#1 lore raw
Quoted 1 line · Oswald Buddenhagen

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.

Quoted 16 lines
---
 sequencer.c | 1 -
 1 file changed, 1 deletion(-)
sequencer.c +0 -1
index 3be23d7ca2..2da9b9f890 100644
@@ -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);
 	}