MCPcopy
hub / github.com/go-git/go-git / TestCheckoutIndexOS

Method TestCheckoutIndexOS

worktree_test.go:761–788  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

759}
760
761func (s *WorktreeSuite) TestCheckoutIndexOS(c *C) {
762 fs := s.TemporalFilesystem(c)
763
764 w := &Worktree{
765 r: s.Repository,
766 Filesystem: fs,
767 }
768
769 err := w.Checkout(&CheckoutOptions{})
770 c.Assert(err, IsNil)
771
772 idx, err := s.Repository.Storer.Index()
773 c.Assert(err, IsNil)
774 c.Assert(idx.Entries, HasLen, 9)
775 c.Assert(idx.Entries[0].Hash.String(), Equals, "32858aad3c383ed1ff0a0f9bdf231d54a00c9e88")
776 c.Assert(idx.Entries[0].Name, Equals, ".gitignore")
777 c.Assert(idx.Entries[0].Mode, Equals, filemode.Regular)
778 c.Assert(idx.Entries[0].ModifiedAt.IsZero(), Equals, false)
779 c.Assert(idx.Entries[0].Size, Equals, uint32(189))
780
781 c.Assert(idx.Entries[0].CreatedAt.IsZero(), Equals, false)
782 if runtime.GOOS != "windows" {
783 c.Assert(idx.Entries[0].Dev, Not(Equals), uint32(0))
784 c.Assert(idx.Entries[0].Inode, Not(Equals), uint32(0))
785 c.Assert(idx.Entries[0].UID, Not(Equals), uint32(0))
786 c.Assert(idx.Entries[0].GID, Not(Equals), uint32(0))
787 }
788}
789
790func (s *WorktreeSuite) TestCheckoutBranch(c *C) {
791 w := &Worktree{

Callers

nothing calls this directly

Calls 5

CheckoutMethod · 0.95
IndexMethod · 0.65
StringMethod · 0.65
IsZeroMethod · 0.65
TemporalFilesystemMethod · 0.45

Tested by

no test coverage detected