(t *testing.T)
| 64 | } |
| 65 | |
| 66 | func TestGetCurrentBranchNotInRepo(t *testing.T) { |
| 67 | tmpDir := testutil.TempDir(t, "test-*") |
| 68 | |
| 69 | originalDir, err := os.Getwd() |
| 70 | require.NoError(t, err, "get current directory for test setup") |
| 71 | defer func() { |
| 72 | _ = os.Chdir(originalDir) |
| 73 | }() |
| 74 | |
| 75 | require.NoError(t, os.Chdir(tmpDir), "change to temp directory for test setup") |
| 76 | |
| 77 | // Don't initialize git - should error |
| 78 | _, err = getCurrentBranch() |
| 79 | assert.Error(t, err, "getCurrentBranch should return an error when not in a git repository") |
| 80 | } |
| 81 | |
| 82 | func TestCreateAndSwitchBranch(t *testing.T) { |
| 83 | tmpDir := testutil.TempDir(t, "test-*") |
nothing calls this directly
no test coverage detected