mirror of https://github.com/databricks/cli.git
Set WorktreeRoot to sync root outside git repo (#2197)
## Changes If git is not detected, set default worktree root to sync root. Otherwise NewFileSet/View raise an error about worktree root being outside view root in acceptance/bundle/sync-paths-dotdot. This behavior is introduced in https://github.com/databricks/cli/pull/1945 Stacked on https://github.com/databricks/cli/pull/2202 ## Tests Existing tests.
This commit is contained in:
parent
c224be5c1f
commit
e9902036b8
|
@ -1,11 +1,7 @@
|
||||||
Error: path "$TMPDIR_PARENT" is not within repository root "$TMPDIR"
|
|
||||||
|
|
||||||
Name: test-bundle
|
Name: test-bundle
|
||||||
Target: default
|
Target: default
|
||||||
Workspace:
|
Workspace:
|
||||||
User: $USERNAME
|
User: $USERNAME
|
||||||
Path: /Workspace/Users/$USERNAME/.bundle/test-bundle/default
|
Path: /Workspace/Users/$USERNAME/.bundle/test-bundle/default
|
||||||
|
|
||||||
Found 1 error
|
Validation OK!
|
||||||
|
|
||||||
Exit code: 1
|
|
||||||
|
|
|
@ -32,7 +32,7 @@ func (m *loadGitDetails) Apply(ctx context.Context, b *bundle.Bundle) diag.Diagn
|
||||||
}
|
}
|
||||||
|
|
||||||
if info.WorktreeRoot == "" {
|
if info.WorktreeRoot == "" {
|
||||||
b.WorktreeRoot = b.BundleRoot
|
b.WorktreeRoot = b.SyncRoot
|
||||||
} else {
|
} else {
|
||||||
b.WorktreeRoot = vfs.MustNew(info.WorktreeRoot)
|
b.WorktreeRoot = vfs.MustNew(info.WorktreeRoot)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue