MCPcopy Index your code
hub / github.com/go-git/go-git / TestTreeDecodeEmptyClearsExistingEntries

Function TestTreeDecodeEmptyClearsExistingEntries

plumbing/object/tree_test.go:1781–1795  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1779}
1780
1781func TestTreeDecodeEmptyClearsExistingEntries(t *testing.T) {
1782 t.Parallel()
1783
1784 obj := &plumbing.MemoryObject{}
1785 obj.SetType(plumbing.TreeObject)
1786
1787 tree := &Tree{
1788 Entries: []TreeEntry{
1789 {Name: "stale", Mode: filemode.Regular},
1790 },
1791 }
1792
1793 require.NoError(t, tree.Decode(obj))
1794 assert.Empty(t, tree.Entries)
1795}
1796
1797func TestTreeDecodeClearsExistingState(t *testing.T) {
1798 t.Parallel()

Callers

nothing calls this directly

Calls 3

SetTypeMethod · 0.95
DecodeMethod · 0.95
EmptyMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…