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 /diff_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 'diff_test.go')
| -rw-r--r-- | diff_test.go | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/diff_test.go b/diff_test.go index e2f810b..3a1e65e 100644 --- a/diff_test.go +++ b/diff_test.go @@ -259,7 +259,7 @@ func TestApplyDiffAddfile(t *testing.T) { defer diff.Free() t.Run("check does not apply to current tree because file exists", func(t *testing.T) { - err = repo.ResetToCommit(addSecondFileCommit, ResetHard, &CheckoutOpts{}) + err = repo.ResetToCommit(addSecondFileCommit, ResetHard, &CheckoutOptions{}) checkFatal(t, err) err = repo.ApplyDiff(diff, ApplyLocationBoth, nil) @@ -269,7 +269,7 @@ func TestApplyDiffAddfile(t *testing.T) { }) t.Run("check apply to correct commit", func(t *testing.T) { - err = repo.ResetToCommit(addFirstFileCommit, ResetHard, &CheckoutOpts{}) + err = repo.ResetToCommit(addFirstFileCommit, ResetHard, &CheckoutOptions{}) checkFatal(t, err) err = repo.ApplyDiff(diff, ApplyLocationBoth, nil) @@ -324,7 +324,7 @@ func TestApplyDiffAddfile(t *testing.T) { }) t.Run("check convert to raw buffer and apply", func(t *testing.T) { - err = repo.ResetToCommit(addFirstFileCommit, ResetHard, &CheckoutOpts{}) + err = repo.ResetToCommit(addFirstFileCommit, ResetHard, &CheckoutOptions{}) checkFatal(t, err) raw, err := diff.ToBuf(DiffFormatPatch) @@ -345,7 +345,7 @@ func TestApplyDiffAddfile(t *testing.T) { t.Run("check apply callbacks work", func(t *testing.T) { // reset the state and get new default options for test resetAndGetOpts := func(t *testing.T) *ApplyOptions { - err = repo.ResetToCommit(addFirstFileCommit, ResetHard, &CheckoutOpts{}) + err = repo.ResetToCommit(addFirstFileCommit, ResetHard, &CheckoutOptions{}) checkFatal(t, err) opts, err := DefaultApplyOptions() @@ -507,8 +507,8 @@ func TestApplyToTree(t *testing.T) { diff: diffAC, error: &GitError{ Message: "hunk at line 1 did not apply", - Code: ErrApplyFail, - Class: ErrClassPatch, + Code: ErrorCodeApplyFail, + Class: ErrorClassPatch, }, }, { @@ -531,8 +531,9 @@ func TestApplyToTree(t *testing.T) { diff: diffAB, applyHunkCallback: func(*DiffHunk) (bool, error) { return true, errors.New("message dropped") }, error: &GitError{ - Code: ErrGeneric, - Class: ErrClassInvalid, + Message: "Generic", + Code: ErrorCodeGeneric, + Class: ErrorClassInvalid, }, }, { @@ -547,8 +548,9 @@ func TestApplyToTree(t *testing.T) { diff: diffAB, applyDeltaCallback: func(*DiffDelta) (bool, error) { return true, errors.New("message dropped") }, error: &GitError{ - Code: ErrGeneric, - Class: ErrClassInvalid, + Message: "Generic", + Code: ErrorCodeGeneric, + Class: ErrorClassInvalid, }, }, } { |
