(t *testing.T)
| 160 | } |
| 161 | |
| 162 | func 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 | |
| 177 | func TestGetShortCommitHash_HEAD(t *testing.T) { |
| 178 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected