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

Function TestResolveInput_RootCommit

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

Source from the content-addressed store, hash-verified

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