rugged icon indicating copy to clipboard operation
rugged copied to clipboard

Rebase finishes incorrectly with rugged later than v0.25.0b2

Open codeout opened this issue 7 years ago • 0 comments

Rugged::Rebase#finish doesn't get back a current branch to the original.

What am I doing wrong?

How to reproduce

57b46eb (Today's HEAD): :x:

$ git clone https://github.com/libgit2/rugged.git
$ cd rugged
4 git submodule update --init
$ rake compile:rugged

$ git checkout -b test
Switched to a new branch 'test'

$ ruby -I lib test.rb
$ git status
HEAD detached at refs/heads/test  # <-- NG
...

2998346 :x:

$ git checkout 2998346
$ git submodule update; rake clean; rake compile:rugged
$ git branch -D test; git co -b test
Deleted branch test (was 57b46eb).
Switched to a new branch 'test'

$ ruby -I lib test.rb
$ git status
HEAD detached from refs/heads/test  # <-- NG
...

2139edd :o:

$ git checkout 2139edd
$ git submodule update; rake clean; rake compile:rugged
$ git branch -D test; git co -b test
Deleted branch test (was 2998346).
Switched to a new branch 'test'

$ ruby -I lib test.rb
$ git status
HEAD detached test  # <-- OK
...

ruby code

# test.ruby

require 'rugged'

repo = Rugged::Repository.new('.')
r = Rugged::Rebase.new(repo, "refs/heads/test", "refs/heads/master")

r.finish({name: 'me', email: '[email protected]'})

codeout avatar Mar 16 '17 16:03 codeout