MCPcopy Create free account
hub / github.com/github/gh-aw / TestCheckWorkflowFileStatusNotInRepo

Function TestCheckWorkflowFileStatusNotInRepo

pkg/cli/git_test.go:328–345  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

326}
327
328func TestCheckWorkflowFileStatusNotInRepo(t *testing.T) {
329 tmpDir := testutil.TempDir(t, "test-*")
330
331 originalDir, err := os.Getwd()
332 require.NoError(t, err, "get current directory for test setup")
333 defer func() {
334 _ = os.Chdir(originalDir)
335 }()
336
337 require.NoError(t, os.Chdir(tmpDir), "change to temp directory for test setup")
338
339 // Don't initialize git - should return empty status without error
340 status, err := checkWorkflowFileStatus("test.md")
341 require.NoError(t, err, "get workflow file status outside a git repository")
342 assert.False(t, status.IsModified, "non-git directory should not report a modified workflow file")
343 assert.False(t, status.IsStaged, "non-git directory should not report a staged workflow file")
344 assert.False(t, status.HasUnpushedCommits, "non-git directory should not report unpushed commits")
345}
346
347func TestExtractHostFromRemoteURL(t *testing.T) {
348 tests := []struct {

Callers

nothing calls this directly

Calls 2

TempDirFunction · 0.92
checkWorkflowFileStatusFunction · 0.85

Tested by

no test coverage detected