Skip to content

Commit 24d2500

Browse files
committedFeb 24, 2020
refactor!: remove pkg folder
BREAKING CHANGE: Pkg folder does not make sense. It was previously used to hide away some config files, but it makes for annoying import paths
1 parent d2659fe commit 24d2500

25 files changed

+34
-34
lines changed
 

‎pkg/branch_diff_commits.go ‎branch_diff_commits.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"fmt"

‎pkg/branch_diff_commits_test.go ‎branch_diff_commits_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"testing"
@@ -23,7 +23,7 @@ func TestBranchDiffCommits(t *testing.T) {
2323
}
2424

2525
func TestBranchDiffCommitsWithMasterMerge(t *testing.T) {
26-
repo, _ := git.PlainOpen("../testdata/commits_on_branch")
26+
repo, _ := git.PlainOpen("./testdata/commits_on_branch")
2727
testGit := &Git{repo: repo}
2828

2929
commits, err := testGit.BranchDiffCommits("behind-master", "origin/master")

‎pkg/commit.go ‎commit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"gopkg.in/src-d/go-git.v4/plumbing"

‎pkg/commit_date.go ‎commit_date.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"time"

‎pkg/commit_test.go ‎commit_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"io/ioutil"

‎pkg/commits_between.go ‎commits_between.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"errors"

‎pkg/commits_between_test.go ‎commits_between_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"io/ioutil"
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
func TestCommitsBetween(t *testing.T) {
14-
repo, _ := git.PlainOpen("../testdata/git_tags")
14+
repo, _ := git.PlainOpen("./testdata/git_tags")
1515
testGit := &Git{repo: repo, DebugLogger: log.New(ioutil.Discard, "", 0)}
1616

1717
head, err := repo.Head()

‎pkg/commits_on_branch.go ‎commits_on_branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"errors"

‎pkg/commits_on_branch_test.go ‎commits_on_branch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"log"

‎pkg/current_branch.go ‎current_branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"gopkg.in/src-d/go-git.v4/plumbing"

‎pkg/current_branch_test.go ‎current_branch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"testing"

‎pkg/current_commit.go ‎current_commit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"gopkg.in/src-d/go-git.v4/plumbing/object"

‎pkg/current_commit_test.go ‎current_commit_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"io/ioutil"

‎pkg/current_tag.go ‎current_tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"errors"

‎pkg/current_tag_test.go ‎current_tag_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"io/ioutil"
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
func TestCurrentTagHappy(t *testing.T) {
12-
testGit, err := OpenGit("../testdata/git_tags", nil)
12+
testGit, err := OpenGit("./testdata/git_tags", nil)
1313

1414
assert.NoError(t, err)
1515

@@ -20,7 +20,7 @@ func TestCurrentTagHappy(t *testing.T) {
2020
}
2121

2222
func TestCurrentTagAnnotatedHappy(t *testing.T) {
23-
testGit, err := OpenGit("../testdata/annotated_git_tags_mix", nil)
23+
testGit, err := OpenGit("./testdata/annotated_git_tags_mix", nil)
2424

2525
assert.NoError(t, err)
2626

‎pkg/docs.go ‎docs.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Package history is a wrapper for Git actions. The main purpose is the unify some functionality in this package.
2-
package history
2+
package git

‎pkg/get_tags.go ‎get_tags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"sort"

‎pkg/get_tags_test.go ‎get_tags_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"testing"
@@ -7,7 +7,7 @@ import (
77
)
88

99
func TestGetTags(t *testing.T) {
10-
testGit, err := OpenGit("../testdata/git_tags", nil)
10+
testGit, err := OpenGit("./testdata/git_tags", nil)
1111

1212
assert.NoError(t, err)
1313

@@ -22,7 +22,7 @@ func TestGetTags(t *testing.T) {
2222
}
2323

2424
func TestAnnotatedGetTags(t *testing.T) {
25-
testGit, err := OpenGit("../testdata/annotated_git_tags_mix", nil)
25+
testGit, err := OpenGit("./testdata/annotated_git_tags_mix", nil)
2626

2727
assert.NoError(t, err)
2828

‎pkg/latest_commit_on_branch.go ‎latest_commit_on_branch.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"gopkg.in/src-d/go-git.v4/plumbing"

‎pkg/latest_commit_on_branch_test.go ‎latest_commit_on_branch_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"testing"

‎pkg/open_git.go ‎open_git.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"io/ioutil"

‎pkg/open_git_test.go ‎open_git_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"testing"
@@ -7,12 +7,12 @@ import (
77
)
88

99
func TestOpenGit(t *testing.T) {
10-
_, err := OpenGit("../", nil)
10+
_, err := OpenGit(".", nil)
1111

1212
// Should not error if this git repository is valid
1313
assert.NoError(t, err)
1414

15-
_, unhappyErr := OpenGit(".", nil)
15+
_, unhappyErr := OpenGit("./unknown", nil)
1616

1717
// Should error opening a folder with missing .git
1818
assert.Error(t, unhappyErr)

‎pkg/previous_tag.go ‎previous_tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"errors"

‎pkg/previous_tag_test.go ‎previous_tag_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"io/ioutil"
@@ -10,7 +10,7 @@ import (
1010
)
1111

1212
func TestPreviousTag(t *testing.T) {
13-
repo, _ := git.PlainOpen("../testdata/git_tags")
13+
repo, _ := git.PlainOpen("./testdata/git_tags")
1414
testGit := &Git{repo: repo, DebugLogger: log.New(ioutil.Discard, "", 0)}
1515

1616
head, err := repo.Head()

‎pkg/tag.go ‎tag.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package history
1+
package git
22

33
import (
44
"time"

0 commit comments

Comments
 (0)
Please sign in to comment.