Gazler / githug

Git your game on!
MIT License
6.86k stars 1.03k forks source link

Fix rename_commit level solution #276

Closed gchazot closed 4 years ago

gchazot commented 4 years ago

Fixes #258

The problem is that repo.commits as an array is not necessarily ordered by parent commits. So repo.commits[1] could virtually be any commit in the repo. As an exemple, here is what I get:

  puts repo.commits[0].message
  puts repo.commits[1].message
  puts repo.commits[2].message

-> BEFORE rebase -i:

Initial commit
First coommit
Second commit

-> AFTER rebase -i and renaming the middle commit:

Second commit
Initial commit
First commit

This fix ensures that we look at the parent of the latest commit.

Gazler commented 4 years ago

Thanks <3