From 241562e2b12d2248c44eed2b228d0117d4b94f8f Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 31 Jan 2023 19:19:16 +0100 Subject: [PATCH] Move git package to libs/git (#189) Fixes #185. --- cmd/sync/sync.go | 2 +- {git => libs/git}/fileset.go | 0 {git => libs/git}/fileset_test.go | 0 {git => libs/git}/git.go | 0 {git => libs/git}/git_test.go | 0 {git => libs/git}/ignore.go | 0 {git => libs/git}/ignore_test.go | 0 {git => libs/git}/repository.go | 0 {git => libs/git}/repository_test.go | 4 ++-- {git => libs/git}/testdata/.gitignore | 0 {git => libs/git}/testdata/a/.gitignore | 0 {git => libs/git}/testdata/a/a.ignore | 0 {git => libs/git}/testdata/a/b/.gitignore | 0 {git => libs/git}/testdata/a/b/b.ignore | 0 {git => libs/git}/testdata/a/b/world.txt | 0 {git => libs/git}/testdata/a/hello.txt | 0 {git => libs/git}/testdata/databricks.yml | 0 {git => libs/git}/testdata/ignorethis/.gitkeep | 0 {git => libs/git}/testdata/ignorethis/ignored.txt | 0 {git => libs/git}/view.go | 0 {git => libs/git}/view_test.go | 0 libs/sync/snapshot_test.go | 2 +- libs/sync/sync.go | 2 +- project/project.go | 2 +- 24 files changed, 6 insertions(+), 6 deletions(-) rename {git => libs/git}/fileset.go (100%) rename {git => libs/git}/fileset_test.go (100%) rename {git => libs/git}/git.go (100%) rename {git => libs/git}/git_test.go (100%) rename {git => libs/git}/ignore.go (100%) rename {git => libs/git}/ignore_test.go (100%) rename {git => libs/git}/repository.go (100%) rename {git => libs/git}/repository_test.go (86%) rename {git => libs/git}/testdata/.gitignore (100%) rename {git => libs/git}/testdata/a/.gitignore (100%) rename {git => libs/git}/testdata/a/a.ignore (100%) rename {git => libs/git}/testdata/a/b/.gitignore (100%) rename {git => libs/git}/testdata/a/b/b.ignore (100%) rename {git => libs/git}/testdata/a/b/world.txt (100%) rename {git => libs/git}/testdata/a/hello.txt (100%) rename {git => libs/git}/testdata/databricks.yml (100%) rename {git => libs/git}/testdata/ignorethis/.gitkeep (100%) rename {git => libs/git}/testdata/ignorethis/ignored.txt (100%) rename {git => libs/git}/view.go (100%) rename {git => libs/git}/view_test.go (100%) diff --git a/cmd/sync/sync.go b/cmd/sync/sync.go index 3872f101..3ccd65f7 100644 --- a/cmd/sync/sync.go +++ b/cmd/sync/sync.go @@ -6,7 +6,7 @@ import ( "time" "github.com/databricks/bricks/cmd/root" - "github.com/databricks/bricks/git" + "github.com/databricks/bricks/libs/git" "github.com/databricks/bricks/libs/sync" "github.com/databricks/bricks/project" "github.com/spf13/cobra" diff --git a/git/fileset.go b/libs/git/fileset.go similarity index 100% rename from git/fileset.go rename to libs/git/fileset.go diff --git a/git/fileset_test.go b/libs/git/fileset_test.go similarity index 100% rename from git/fileset_test.go rename to libs/git/fileset_test.go diff --git a/git/git.go b/libs/git/git.go similarity index 100% rename from git/git.go rename to libs/git/git.go diff --git a/git/git_test.go b/libs/git/git_test.go similarity index 100% rename from git/git_test.go rename to libs/git/git_test.go diff --git a/git/ignore.go b/libs/git/ignore.go similarity index 100% rename from git/ignore.go rename to libs/git/ignore.go diff --git a/git/ignore_test.go b/libs/git/ignore_test.go similarity index 100% rename from git/ignore_test.go rename to libs/git/ignore_test.go diff --git a/git/repository.go b/libs/git/repository.go similarity index 100% rename from git/repository.go rename to libs/git/repository.go diff --git a/git/repository_test.go b/libs/git/repository_test.go similarity index 86% rename from git/repository_test.go rename to libs/git/repository_test.go index 9658c39d..63eade73 100644 --- a/git/repository_test.go +++ b/libs/git/repository_test.go @@ -22,7 +22,7 @@ func (r *testRepository) Ignore(relPath string) bool { func TestRepository(t *testing.T) { // Load this repository as test. - repo, err := NewRepository("..") + repo, err := NewRepository("../..") tr := testRepository{t, repo} require.NoError(t, err) @@ -33,5 +33,5 @@ func TestRepository(t *testing.T) { assert.True(t, tr.Ignore("vendor/")) // Check that ignores under testdata work. - assert.True(t, tr.Ignore(filepath.Join("git", "testdata", "root.ignoreme"))) + assert.True(t, tr.Ignore(filepath.Join("libs", "git", "testdata", "root.ignoreme"))) } diff --git a/git/testdata/.gitignore b/libs/git/testdata/.gitignore similarity index 100% rename from git/testdata/.gitignore rename to libs/git/testdata/.gitignore diff --git a/git/testdata/a/.gitignore b/libs/git/testdata/a/.gitignore similarity index 100% rename from git/testdata/a/.gitignore rename to libs/git/testdata/a/.gitignore diff --git a/git/testdata/a/a.ignore b/libs/git/testdata/a/a.ignore similarity index 100% rename from git/testdata/a/a.ignore rename to libs/git/testdata/a/a.ignore diff --git a/git/testdata/a/b/.gitignore b/libs/git/testdata/a/b/.gitignore similarity index 100% rename from git/testdata/a/b/.gitignore rename to libs/git/testdata/a/b/.gitignore diff --git a/git/testdata/a/b/b.ignore b/libs/git/testdata/a/b/b.ignore similarity index 100% rename from git/testdata/a/b/b.ignore rename to libs/git/testdata/a/b/b.ignore diff --git a/git/testdata/a/b/world.txt b/libs/git/testdata/a/b/world.txt similarity index 100% rename from git/testdata/a/b/world.txt rename to libs/git/testdata/a/b/world.txt diff --git a/git/testdata/a/hello.txt b/libs/git/testdata/a/hello.txt similarity index 100% rename from git/testdata/a/hello.txt rename to libs/git/testdata/a/hello.txt diff --git a/git/testdata/databricks.yml b/libs/git/testdata/databricks.yml similarity index 100% rename from git/testdata/databricks.yml rename to libs/git/testdata/databricks.yml diff --git a/git/testdata/ignorethis/.gitkeep b/libs/git/testdata/ignorethis/.gitkeep similarity index 100% rename from git/testdata/ignorethis/.gitkeep rename to libs/git/testdata/ignorethis/.gitkeep diff --git a/git/testdata/ignorethis/ignored.txt b/libs/git/testdata/ignorethis/ignored.txt similarity index 100% rename from git/testdata/ignorethis/ignored.txt rename to libs/git/testdata/ignorethis/ignored.txt diff --git a/git/view.go b/libs/git/view.go similarity index 100% rename from git/view.go rename to libs/git/view.go diff --git a/git/view_test.go b/libs/git/view_test.go similarity index 100% rename from git/view_test.go rename to libs/git/view_test.go diff --git a/libs/sync/snapshot_test.go b/libs/sync/snapshot_test.go index a5779ca3..04661f9a 100644 --- a/libs/sync/snapshot_test.go +++ b/libs/sync/snapshot_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/databricks/bricks/git" + "github.com/databricks/bricks/libs/git" "github.com/databricks/bricks/libs/testfile" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/libs/sync/sync.go b/libs/sync/sync.go index 4c13688a..fe326f12 100644 --- a/libs/sync/sync.go +++ b/libs/sync/sync.go @@ -7,7 +7,7 @@ import ( "sync" "time" - "github.com/databricks/bricks/git" + "github.com/databricks/bricks/libs/git" "github.com/databricks/bricks/libs/sync/repofiles" "github.com/databricks/databricks-sdk-go" ) diff --git a/project/project.go b/project/project.go index 97d16281..585b15a8 100644 --- a/project/project.go +++ b/project/project.go @@ -7,7 +7,7 @@ import ( "path/filepath" "sync" - "github.com/databricks/bricks/git" + "github.com/databricks/bricks/libs/git" "github.com/databricks/databricks-sdk-go" "github.com/databricks/databricks-sdk-go/service/commands" "github.com/databricks/databricks-sdk-go/service/scim"