(t *testing.T)
| 73 | } |
| 74 | |
| 75 | func TestCreateWithEmptyBaseUsesHead(t *testing.T) { |
| 76 | t.Parallel() |
| 77 | dir := bootstrapRepo(t) |
| 78 | |
| 79 | head := gitOut(t, dir, "rev-parse", "HEAD") |
| 80 | |
| 81 | // An empty base is ignored: the worktree branches from the current HEAD. |
| 82 | wt, err := Create(t.Context(), dir, "default-base", WithRoot(t.TempDir()), WithBase("")) |
| 83 | require.NoError(t, err) |
| 84 | assert.Equal(t, head, gitOut(t, wt.Dir, "rev-parse", "HEAD")) |
| 85 | } |
| 86 | |
| 87 | func TestCreateWithInvalidBase(t *testing.T) { |
| 88 | t.Parallel() |