MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestResolveInput_RootCommit

Function TestResolveInput_RootCommit

internal/diff/git_resolve_test.go:90–106  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestResolveInput_RootCommit(t *testing.T) {
91 repo := initBareRepo(t)
92 writeCommit(t, repo, "a.txt", "one\n", "root")
93 head := gitOut(t, repo, "rev-parse", "HEAD")
94
95 p := NewCommitProvider(repo, head, nil)
96 got := p.ResolveInput(context.Background())
97 if got.ResolvedHead != head {
98 t.Errorf("ResolvedHead = %q, want %q", got.ResolvedHead, head)
99 }
100 if got.ResolvedBase != "" {
101 t.Errorf("ResolvedBase = %q, want empty for a root commit", got.ResolvedBase)
102 }
103 if got.ExactRange != "" {
104 t.Errorf("ExactRange = %q, want empty for a root commit", got.ExactRange)
105 }
106}
107
108func TestResolveInput_MergeCommit(t *testing.T) {
109 repo := initBareRepo(t)

Callers

nothing calls this directly

Calls 5

initBareRepoFunction · 0.85
writeCommitFunction · 0.85
gitOutFunction · 0.85
NewCommitProviderFunction · 0.85
ResolveInputMethod · 0.80

Tested by

no test coverage detected