lazygit: "Move patch into new commit" sometimes fails

Describe the bug Sometimes when using “Move patch into new commit”, I get error: <changed file>: does not exist in index.

To Reproduce This was hard to pinpoint, but the following steps reproduce the behavior for me consistently:

  1. In an empty directory, run the following commands
git init
touch test.txt
git add .
git commit -m 1

echo "one" > test.txt 
git add .
git commit -m 2

echo "
two" >> test.txt
git add .
git commit -m 3
  1. In lazygit, try to move the empty line between “one” and “two” from the last commit into a new commit -> error!

Expected behavior There is a new, 4th commit called Split from "3" only containing the empty line between “one” and “two”

Version info: Lazygit: 0.33 and master at 448ff80d git: 2.35.1

Additional context So far, I’ve only tested this on 2 different Debian machines. I’m planning on debugging this some more, but would be happy about any input.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 15 (2 by maintainers)

Most upvoted comments

In case anyone wants to take a shot at this, I pushed a failing test onto 2153-move-patch-into-new-commit-sometimes-fails.