diff options
| author | lhchavez <[email protected]> | 2020-12-05 07:23:44 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-12-05 07:23:44 -0800 |
| commit | 137c05e802d5e11a5ab54809bc8be8f61ccece21 (patch) | |
| tree | b44997824565f9506744a4259177746b83112e92 /rebase_test.go | |
| parent | 1fabe95fb7275df980ff6ab03fb85eac91c5849d (diff) | |
Mark some symbols to be deprecated #minor (#698)
This change introduces the file deprecated.go, which contains any
constants, functions, and types that are slated to be deprecated in the
next major release.
These symbols are deprecated because they refer to old spellings in
pre-1.0 libgit2. This also makes the build be done with the
`-DDEPRECATE_HARD` flag to avoid regressions.
This, together with
[gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should
make releases safer going forward.
1: More information about how that works at
https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md
Diffstat (limited to 'rebase_test.go')
| -rw-r--r-- | rebase_test.go | 30 |
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 } |
