git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

How to `git rebase --root` ?

Open oknozor opened this issue 3 years ago • 0 comments

Hello, I a trying to implement an interactive rebase to modify all commit in a repository, including the first one. The git cli provides the --root option to do so but I am having trouble translating this to git2-rs. Reading at libgit2 doc I am still not sure what argument is expected to perform a "root" rebase ?

repository.rebase(
  Some(&head), // Current branch
  None, // No upstream to get all reachable commits
  Some(&onto), // needs to be provided or we get the following error : "Error: invalid argument: 'upstream || onto'; class=Invalid (3)
" 
  None // No opt ? 
)?;

Doing so on a repository containing only the first commit, I am not able to reach it. Any hint ?

oknozor avatar Feb 06 '22 07:02 oknozor