(t *testing.T)
| 212 | } |
| 213 | |
| 214 | func TestIndexAddAllCallback(t *testing.T) { |
| 215 | t.Parallel() |
| 216 | repo := createTestRepo(t) |
| 217 | defer cleanupTestRepo(t, repo) |
| 218 | |
| 219 | err := ioutil.WriteFile(repo.Workdir()+"/README", []byte("foo\n"), 0644) |
| 220 | checkFatal(t, err) |
| 221 | |
| 222 | idx, err := repo.Index() |
| 223 | checkFatal(t, err) |
| 224 | |
| 225 | cbPath := "" |
| 226 | err = idx.AddAll([]string{}, IndexAddDefault, func(p, mP string) error { |
| 227 | cbPath = p |
| 228 | return nil |
| 229 | }) |
| 230 | checkFatal(t, err) |
| 231 | if cbPath != "README" { |
| 232 | t.Fatalf("%v", cbPath) |
| 233 | } |
| 234 | |
| 235 | treeId, err := idx.WriteTreeTo(repo) |
| 236 | checkFatal(t, err) |
| 237 | |
| 238 | if treeId.String() != "b7119b11e8ef7a1a5a34d3ac87f5b075228ac81e" { |
| 239 | t.Fatalf("%v", treeId.String()) |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | func TestIndexOpen(t *testing.T) { |
| 244 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…