summaryrefslogtreecommitdiff
path: root/rebase_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'rebase_test.go')
-rw-r--r--rebase_test.go30
1 files changed, 15 insertions, 15 deletions
diff --git a/rebase_test.go b/rebase_test.go
index a78e6c7..65df522 100644
--- a/rebase_test.go
+++ b/rebase_test.go
@@ -38,12 +38,12 @@ func TestRebaseAbort(t *testing.T) {
seedTestRepo(t, repo)
// Setup a repo with 2 branches and a different tree
- err := setupRepoForRebase(repo, masterCommit, branchName, commitOpts{})
+ err := setupRepoForRebase(repo, masterCommit, branchName, commitOptions{})
checkFatal(t, err)
// Create several commits in emile
for _, commit := range emileCommits {
- _, err = commitSomething(repo, commit, commit, commitOpts{})
+ _, err = commitSomething(repo, commit, commit, commitOptions{})
checkFatal(t, err)
}
@@ -99,12 +99,12 @@ func TestRebaseNoConflicts(t *testing.T) {
}
// Setup a repo with 2 branches and a different tree
- err = setupRepoForRebase(repo, masterCommit, branchName, commitOpts{})
+ err = setupRepoForRebase(repo, masterCommit, branchName, commitOptions{})
checkFatal(t, err)
// Create several commits in emile
for _, commit := range emileCommits {
- _, err = commitSomething(repo, commit, commit, commitOpts{})
+ _, err = commitSomething(repo, commit, commit, commitOptions{})
checkFatal(t, err)
}
@@ -143,7 +143,7 @@ func TestRebaseGpgSigned(t *testing.T) {
entity, err := openpgp.NewEntity("Namey mcnameface", "test comment", "[email protected]", nil)
checkFatal(t, err)
- opts, err := DefaultRebaseOptions()
+ rebaseOpts, err := DefaultRebaseOptions()
checkFatal(t, err)
signCommitContent := func(commitContent string) (string, string, error) {
@@ -155,9 +155,9 @@ func TestRebaseGpgSigned(t *testing.T) {
return cipherText.String(), "", nil
}
- opts.CommitSigningCallback = signCommitContent
+ rebaseOpts.CommitSigningCallback = signCommitContent
- commitOpts := commitOpts{
+ commitOpts := commitOptions{
CommitSigningCallback: signCommitContent,
}
@@ -201,7 +201,7 @@ func TestRebaseGpgSigned(t *testing.T) {
}
// Rebase onto master
- rebase, err := performRebaseOnto(repo, "master", &opts)
+ rebase, err := performRebaseOnto(repo, "master", &rebaseOpts)
checkFatal(t, err)
defer rebase.Free()
@@ -255,7 +255,7 @@ func checkCommitSigned(t *testing.T, entity *openpgp.Entity, commit *Commit) err
}
// Utils
-func setupRepoForRebase(repo *Repository, masterCommit, branchName string, opts commitOpts) error {
+func setupRepoForRebase(repo *Repository, masterCommit, branchName string, commitOpts commitOptions) error {
// Create a new branch from master
err := createBranch(repo, branchName)
if err != nil {
@@ -263,7 +263,7 @@ func setupRepoForRebase(repo *Repository, masterCommit, branchName string, opts
}
// Create a commit in master
- _, err = commitSomething(repo, masterCommit, masterCommit, opts)
+ _, err = commitSomething(repo, masterCommit, masterCommit, commitOpts)
if err != nil {
return err
}
@@ -282,7 +282,7 @@ func setupRepoForRebase(repo *Repository, masterCommit, branchName string, opts
return nil
}
-func performRebaseOnto(repo *Repository, branch string, opts *RebaseOptions) (*Rebase, error) {
+func performRebaseOnto(repo *Repository, branch string, rebaseOpts *RebaseOptions) (*Rebase, error) {
master, err := repo.LookupBranch(branch, BranchLocal)
if err != nil {
return nil, err
@@ -296,7 +296,7 @@ func performRebaseOnto(repo *Repository, branch string, opts *RebaseOptions) (*R
defer onto.Free()
// Init rebase
- rebase, err := repo.InitRebase(nil, nil, onto, opts)
+ rebase, err := repo.InitRebase(nil, nil, onto, rebaseOpts)
if err != nil {
return nil, err
}
@@ -397,7 +397,7 @@ func headTree(repo *Repository) (*Tree, error) {
return tree, nil
}
-func commitSomething(repo *Repository, something, content string, commitOpts commitOpts) (*Oid, error) {
+func commitSomething(repo *Repository, something, content string, commitOpts commitOptions) (*Oid, error) {
headCommit, err := headCommit(repo)
if err != nil {
return nil, err
@@ -470,10 +470,10 @@ func commitSomething(repo *Repository, something, content string, commitOpts com
}
}
- opts := &CheckoutOpts{
+ checkoutOpts := &CheckoutOptions{
Strategy: CheckoutRemoveUntracked | CheckoutForce,
}
- err = repo.CheckoutIndex(index, opts)
+ err = repo.CheckoutIndex(index, checkoutOpts)
if err != nil {
return nil, err
}