MCPcopy Create free account
hub / github.com/libgit2/git2go / checkNoFilesStaged

Function checkNoFilesStaged

diff_test.go:631–646  ·  view source on GitHub ↗

checkNoFilesStaged checks that there is a single file called "file2" uncommitted in the repo

(t *testing.T, repo *Repository)

Source from the content-addressed store, hash-verified

629
630// checkNoFilesStaged checks that there is a single file called "file2" uncommitted in the repo
631func checkNoFilesStaged(t *testing.T, repo *Repository) {
632 opts := StatusOptions{
633 Show: StatusShowIndexAndWorkdir,
634 Flags: StatusOptIncludeUntracked,
635 }
636
637 statuses, err := repo.StatusList(&opts)
638 checkFatal(t, err)
639
640 count, err := statuses.EntryCount()
641 checkFatal(t, err)
642
643 if count != 0 {
644 t.Error("files changed unexpectedly")
645 }
646}
647
648// addAndGetTree creates a file and commits it, returning the commit and tree
649func addAndGetTree(t *testing.T, repo *Repository, filename string, content string) (*Commit, *Tree) {

Callers 1

TestApplyDiffAddfileFunction · 0.85

Calls 4

checkFatalFunction · 0.85
StatusListMethod · 0.80
ErrorMethod · 0.80
EntryCountMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…