MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / TestHasUncommittedChanges_ModifiedFile

Function TestHasUncommittedChanges_ModifiedFile

vcs/git/git_test.go:237–252  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

235}
236
237func TestHasUncommittedChanges_ModifiedFile(t *testing.T) {
238 tmpDir := t.TempDir()
239 setupGitRepo(t, tmpDir)
240
241 filePath := createFile(t, tmpDir, "test.txt", "content")
242 gitAdd(t, tmpDir, "test.txt")
243 gitCommit(t, tmpDir, "Initial commit")
244
245 // Modify the file
246 modifyFile(t, filePath)
247
248 hasChanges, err := HasUncommittedChanges(tmpDir)
249
250 require.NoError(t, err)
251 assert.True(t, hasChanges)
252}
253
254func TestHasUncommittedChanges_StagedFile(t *testing.T) {
255 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 6

setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitFunction · 0.85
modifyFileFunction · 0.85
HasUncommittedChangesFunction · 0.85

Tested by

no test coverage detected