MCPcopy Create free account
hub / github.com/JanSmrcka/differ / TestCommitDiff

Function TestCommitDiff

internal/git/repo_test.go:486–500  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

484}
485
486func TestCommitDiff(t *testing.T) {
487 t.Parallel()
488 repo := setupTestRepo(t)
489 addCommit(t, repo, "f.txt", "v1", "init")
490 addCommit(t, repo, "f.txt", "v2", "update")
491
492 commits, _ := repo.Log(1)
493 diff, err := repo.CommitDiff(commits[0].Hash)
494 if err != nil {
495 t.Fatal(err)
496 }
497 if diff == "" {
498 t.Error("expected non-empty commit diff")
499 }
500}
501
502func TestListBranches(t *testing.T) {
503 t.Parallel()

Callers

nothing calls this directly

Calls 4

setupTestRepoFunction · 0.85
addCommitFunction · 0.85
LogMethod · 0.80
CommitDiffMethod · 0.80

Tested by

no test coverage detected