| 1 | package git |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/require" |
| 7 | ) |
| 8 | |
| 9 | func TestNextBranch(t *testing.T) { |
| 10 | |
| 11 | } |
| 12 | |
| 13 | func TestPreviousBranch(t *testing.T) { |
| 14 | |
| 15 | } |
| 16 | |
| 17 | func TestRevlistNew(t *testing.T) { |
| 18 | th := InitTestRepositoryFromLocal(t) |
| 19 | defer th.CleanUp(t) |
| 20 | |
| 21 | r := th.Repository |
| 22 | // HEAD..@{u} |
| 23 | headref, err := r.Repo.Head() |
| 24 | if err != nil { |
| 25 | t.Fatalf("Test Failed. error: %s", err.Error()) |
| 26 | } |
| 27 | |
| 28 | head := headref.Hash().String() |
| 29 | |
| 30 | pullables, err := RevList(r, RevListOptions{ |
| 31 | Ref1: head, |
| 32 | Ref2: r.State.Branch.Upstream.Reference.Hash().String(), |
| 33 | }) |
| 34 | require.NoError(t, err) |
| 35 | require.Empty(t, pullables) |
| 36 | |
| 37 | pushables, err := RevList(r, RevListOptions{ |
| 38 | Ref1: r.State.Branch.Upstream.Reference.Hash().String(), |
| 39 | Ref2: head, |
| 40 | }) |
| 41 | require.NoError(t, err) |
| 42 | require.Empty(t, pushables) |
| 43 | } |