(t *testing.T)
| 356 | } |
| 357 | |
| 358 | func TestIsAncestor_False(t *testing.T) { |
| 359 | tmpDir := t.TempDir() |
| 360 | setupGitRepo(t, tmpDir) |
| 361 | |
| 362 | // Create first commit |
| 363 | createFile(t, tmpDir, "first.txt", "content") |
| 364 | gitAdd(t, tmpDir, "first.txt") |
| 365 | firstCommit := gitCommitAndGetSHA(t, tmpDir, "First commit") |
| 366 | |
| 367 | // Create second commit |
| 368 | createFile(t, tmpDir, "second.txt", "content") |
| 369 | gitAdd(t, tmpDir, "second.txt") |
| 370 | secondCommit := gitCommitAndGetSHA(t, tmpDir, "Second commit") |
| 371 | |
| 372 | // Second should NOT be ancestor of first |
| 373 | result, err := isAncestor(tmpDir, secondCommit, firstCommit) |
| 374 | |
| 375 | require.NoError(t, err) |
| 376 | assert.False(t, result) |
| 377 | } |
| 378 | |
| 379 | func TestIsAncestor_SameCommit(t *testing.T) { |
| 380 | tmpDir := t.TempDir() |
nothing calls this directly
no test coverage detected