(c *C)
| 1834 | } |
| 1835 | |
| 1836 | func (s *RepositorySuite) TestLogAllMissingReferences(c *C) { |
| 1837 | r, _ := Init(memory.NewStorage(), nil) |
| 1838 | err := r.clone(context.Background(), &CloneOptions{ |
| 1839 | URL: s.GetBasicLocalRepositoryURL(), |
| 1840 | }) |
| 1841 | c.Assert(err, IsNil) |
| 1842 | err = r.Storer.RemoveReference(plumbing.HEAD) |
| 1843 | c.Assert(err, IsNil) |
| 1844 | |
| 1845 | rIter, err := r.Storer.IterReferences() |
| 1846 | c.Assert(err, IsNil) |
| 1847 | |
| 1848 | refCount := 0 |
| 1849 | err = rIter.ForEach(func(ref *plumbing.Reference) error { |
| 1850 | refCount++ |
| 1851 | return nil |
| 1852 | }) |
| 1853 | c.Assert(err, IsNil) |
| 1854 | c.Assert(refCount, Equals, 4) |
| 1855 | |
| 1856 | err = r.Storer.SetReference(plumbing.NewHashReference(plumbing.ReferenceName("DUMMY"), plumbing.NewHash("DUMMY"))) |
| 1857 | c.Assert(err, IsNil) |
| 1858 | |
| 1859 | rIter, err = r.Storer.IterReferences() |
| 1860 | c.Assert(err, IsNil) |
| 1861 | |
| 1862 | refCount = 0 |
| 1863 | err = rIter.ForEach(func(ref *plumbing.Reference) error { |
| 1864 | refCount++ |
| 1865 | return nil |
| 1866 | }) |
| 1867 | c.Assert(err, IsNil) |
| 1868 | c.Assert(refCount, Equals, 5) |
| 1869 | |
| 1870 | cIter, err := r.Log(&LogOptions{ |
| 1871 | All: true, |
| 1872 | }) |
| 1873 | c.Assert(cIter, NotNil) |
| 1874 | c.Assert(err, IsNil) |
| 1875 | |
| 1876 | cCount := 0 |
| 1877 | cIter.ForEach(func(c *object.Commit) error { |
| 1878 | cCount++ |
| 1879 | return nil |
| 1880 | }) |
| 1881 | c.Assert(cCount, Equals, 9) |
| 1882 | |
| 1883 | _, err = cIter.Next() |
| 1884 | c.Assert(err, Equals, io.EOF) |
| 1885 | cIter.Close() |
| 1886 | } |
| 1887 | |
| 1888 | func (s *RepositorySuite) TestLogAllOrderByTime(c *C) { |
| 1889 | r, _ := Init(memory.NewStorage(), nil) |
nothing calls this directly
no test coverage detected