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

Function TestGetShortCommitHash_HEAD

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

Source from the content-addressed store, hash-verified

175}
176
177func TestGetShortCommitHash_HEAD(t *testing.T) {
178 tmpDir := t.TempDir()
179 setupGitRepo(t, tmpDir)
180
181 createFile(t, tmpDir, "test.txt", "content")
182 gitAdd(t, tmpDir, "test.txt")
183 gitCommit(t, tmpDir, "Initial commit")
184
185 shortHash, err := GetShortCommitHash(tmpDir, "HEAD")
186
187 require.NoError(t, err)
188 assert.NotEmpty(t, shortHash)
189}
190
191func TestGetShortCommitHash_InvalidCommit(t *testing.T) {
192 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 5

setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitFunction · 0.85
GetShortCommitHashFunction · 0.85

Tested by

no test coverage detected