(t *testing.T)
| 89 | } |
| 90 | |
| 91 | func TestRebaseAbort(t *testing.T) { |
| 92 | // TEST DATA |
| 93 | |
| 94 | // Inputs |
| 95 | branchName := "emile" |
| 96 | masterCommit := "something" |
| 97 | emileCommits := []string{ |
| 98 | "fou", |
| 99 | "barre", |
| 100 | } |
| 101 | |
| 102 | // Outputs |
| 103 | expectedHistory := []string{ |
| 104 | "Test rebase, Baby! " + emileCommits[1], |
| 105 | "Test rebase, Baby! " + emileCommits[0], |
| 106 | "This is a commit\n", |
| 107 | } |
| 108 | |
| 109 | // TEST |
| 110 | repo := createTestRepo(t) |
| 111 | defer cleanupTestRepo(t, repo) |
| 112 | seedTestRepo(t, repo) |
| 113 | |
| 114 | // Setup a repo with 2 branches and a different tree |
| 115 | err := setupRepoForRebase(repo, masterCommit, branchName, commitOptions{}) |
| 116 | checkFatal(t, err) |
| 117 | |
| 118 | // Create several commits in emile |
| 119 | for _, commit := range emileCommits { |
| 120 | _, err = commitSomething(repo, commit, commit, commitOptions{}) |
| 121 | checkFatal(t, err) |
| 122 | } |
| 123 | |
| 124 | // Check history |
| 125 | actualHistory, err := commitMsgsList(repo) |
| 126 | checkFatal(t, err) |
| 127 | assertStringList(t, expectedHistory, actualHistory) |
| 128 | |
| 129 | // Rebase onto master |
| 130 | rebase, err := performRebaseOnto(repo, "master", nil) |
| 131 | checkFatal(t, err) |
| 132 | defer rebase.Free() |
| 133 | |
| 134 | // Abort rebase |
| 135 | rebase.Abort() |
| 136 | |
| 137 | // Check history is still the same |
| 138 | actualHistory, err = commitMsgsList(repo) |
| 139 | checkFatal(t, err) |
| 140 | assertStringList(t, expectedHistory, actualHistory) |
| 141 | } |
| 142 | |
| 143 | func TestRebaseNoConflicts(t *testing.T) { |
| 144 | // TEST DATA |
nothing calls this directly
no test coverage detected
searching dependent graphs…