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

Function TestGetShortCommitHash_AlreadyShort

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

Source from the content-addressed store, hash-verified

160}
161
162func TestGetShortCommitHash_AlreadyShort(t *testing.T) {
163 tmpDir := t.TempDir()
164 setupGitRepo(t, tmpDir)
165
166 createFile(t, tmpDir, "test.txt", "content")
167 gitAdd(t, tmpDir, "test.txt")
168 fullHash := gitCommitAndGetSHA(t, tmpDir, "Initial commit")
169
170 // Get short hash first
171 shortHash, err := GetShortCommitHash(tmpDir, fullHash[:7])
172
173 require.NoError(t, err)
174 assert.NotEmpty(t, shortHash)
175}
176
177func TestGetShortCommitHash_HEAD(t *testing.T) {
178 tmpDir := t.TempDir()

Callers

nothing calls this directly

Calls 5

setupGitRepoFunction · 0.85
createFileFunction · 0.85
gitAddFunction · 0.85
gitCommitAndGetSHAFunction · 0.85
GetShortCommitHashFunction · 0.85

Tested by

no test coverage detected