# [PATCH] sequencer: remove duplicate rollback_lock_file() call

4 messages from 2020-10-21 to 2020-10-22. Participants: Elijah Newren via GitGitGadget, Taylor Blau, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/54476

## Elijah Newren via GitGitGadget, 2020-10-21 13:24

Subject: [PATCH] sequencer: remove duplicate rollback_lock_file() call
Message-ID: <pull.894.git.git.1603286675709.gitgitgadget@gmail.com>
URL: https://gitlist.dev/e/pull.894.git.git.1603286675709.gitgitgadget%40gmail.com

```
From: Elijah Newren <newren@gmail.com>

Commit 2b6ad0f4bc ("rebase --rebase-merges: add support for octopus
merges", 2017-12-21) introduced a case where rollback_lock_file() was
unconditionally called twice in a row with no intervening commands.
Remove the duplicate.

Signed-off-by: Elijah Newren <newren@gmail.com>
---
    sequencer: remove duplicate rollback_lock_file() call

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-894%2Fnewren%2Fremove-duplicate-sequencer-code-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-894/newren/remove-duplicate-sequencer-code-v1
Pull-Request: https://github.com/git/git/pull/894

 sequencer.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sequencer.c b/sequencer.c
index 00acb12496..baff51035e 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -3689,7 +3689,6 @@ static int do_merge(struct repository *r,
 				NULL, 0);
 		rollback_lock_file(&lock);
 
-		rollback_lock_file(&lock);
 		ret = run_command(&cmd);
 
 		/* force re-reading of the cache */

base-commit: 69986e19ffcfb9af674ae5180689ab7bbf92ed28
-- 
gitgitgadget

```

## Taylor Blau, 2020-10-21 17:17

Subject: Re: [PATCH] sequencer: remove duplicate rollback_lock_file() call
Message-ID: <20201021171727.GA1237181@nand.local>
URL: https://gitlist.dev/e/20201021171727.GA1237181%40nand.local
In-Reply-To: <pull.894.git.git.1603286675709.gitgitgadget@gmail.com>

```
Hi Elijah,

On Wed, Oct 21, 2020 at 01:24:35PM +0000, Elijah Newren via GitGitGadget wrote:
> diff --git a/sequencer.c b/sequencer.c
> index 00acb12496..baff51035e 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -3689,7 +3689,6 @@ static int do_merge(struct repository *r,
>  				NULL, 0);
>  		rollback_lock_file(&lock);
>
> -		rollback_lock_file(&lock);

Looks obviously good to me, thanks.

  Reviewed-by: Taylor Blau <me@ttaylorr.com>

Thanks,
Taylor

```

## Junio C Hamano, 2020-10-21 19:55

Subject: Re: [PATCH] sequencer: remove duplicate rollback_lock_file() call
Message-ID: <xmqqmu0f73s6.fsf@gitster.c.googlers.com>
URL: https://gitlist.dev/e/xmqqmu0f73s6.fsf%40gitster.c.googlers.com
In-Reply-To: <20201021171727.GA1237181@nand.local>

```
Taylor Blau <me@ttaylorr.com> writes:

> Hi Elijah,
>
> On Wed, Oct 21, 2020 at 01:24:35PM +0000, Elijah Newren via GitGitGadget wrote:
>> diff --git a/sequencer.c b/sequencer.c
>> index 00acb12496..baff51035e 100644
>> --- a/sequencer.c
>> +++ b/sequencer.c
>> @@ -3689,7 +3689,6 @@ static int do_merge(struct repository *r,
>>  				NULL, 0);
>>  		rollback_lock_file(&lock);
>>
>> -		rollback_lock_file(&lock);
>
> Looks obviously good to me, thanks.
>
>   Reviewed-by: Taylor Blau <me@ttaylorr.com>
>
> Thanks,
> Taylor

Thanks, both.  That's an embarrassing one.

```

## Johannes Schindelin, 2020-10-22 09:12

Subject: Re: [PATCH] sequencer: remove duplicate rollback_lock_file() call
Message-ID: <nycvar.QRO.7.76.6.2010221111320.56@tvgsbejvaqbjf.bet>
URL: https://gitlist.dev/e/nycvar.QRO.7.76.6.2010221111320.56%40tvgsbejvaqbjf.bet
In-Reply-To: <pull.894.git.git.1603286675709.gitgitgadget@gmail.com>

```
Hi Elijah,

On Wed, 21 Oct 2020, Elijah Newren via GitGitGadget wrote:

> From: Elijah Newren <newren@gmail.com>
>
> Commit 2b6ad0f4bc ("rebase --rebase-merges: add support for octopus
> merges", 2017-12-21) introduced a case where rollback_lock_file() was
> unconditionally called twice in a row with no intervening commands.
> Remove the duplicate.

Thank you for cleaning up after me. I _know_ that this slipped in a couple
times during my rebasing, and still, this last time it slipped through.

ACK,
Dscho

```
