checkNoFilesStaged checks that there is a single file called "file2" uncommitted in the repo
(t *testing.T, repo *Repository)
| 629 | |
| 630 | // checkNoFilesStaged checks that there is a single file called "file2" uncommitted in the repo |
| 631 | func 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 |
| 649 | func addAndGetTree(t *testing.T, repo *Repository, filename string, content string) (*Commit, *Tree) { |
no test coverage detected
searching dependent graphs…