Selaa lähdekoodia

Improve TestBlobCacheGetBlobIgnoreMissing test

Vadim Markovtsev 7 vuotta sitten
vanhempi
commit
9a915a9bc9
1 muutettua tiedostoa jossa 6 lisäystä ja 0 poistoa
  1. 6 0
      blob_cache_test.go

+ 6 - 0
blob_cache_test.go

@@ -292,6 +292,12 @@ func TestBlobCacheGetBlobIgnoreMissing(t *testing.T) {
 	assert.Nil(t, err)
 	assert.Equal(t, blob.Size, int64(0))
 	cache.IgnoreMissingSubmodules = false
+	getter = func(path string) (*object.File, error) {
+		assert.Equal(t, path, ".gitmodules")
+		commit, _ := testRepository.CommitObject(plumbing.NewHash(
+			"13272b66c55e1ba1237a34104f30b84d7f6e4082"))
+		return commit.File("test_data/gitmodules")
+	}
 	blob, err = cache.getBlob(&entry, getter)
 	assert.Nil(t, blob)
 	assert.NotNil(t, err)