MCPcopy Create free account
hub / github.com/go-git/go-git / copyFile

Function copyFile

storage/filesystem/object_test.go:285–298  ·  view source on GitHub ↗
(c *C, dstDir, dstFilename string, srcFile billy.File)

Source from the content-addressed store, hash-verified

283}
284
285func copyFile(c *C, dstDir, dstFilename string, srcFile billy.File) {
286 _, err := srcFile.Seek(0, 0)
287 c.Assert(err, IsNil)
288
289 err = osfs.Default.MkdirAll(dstDir, 0750|os.ModeDir)
290 c.Assert(err, IsNil)
291
292 dst, err := osfs.Default.OpenFile(filepath.Join(dstDir, dstFilename), os.O_CREATE|os.O_WRONLY, 0666)
293 c.Assert(err, IsNil)
294 defer dst.Close()
295
296 _, err = io.Copy(dst, srcFile)
297 c.Assert(err, IsNil)
298}
299
300// TestPackfileReindex tests that externally-added packfiles are considered by go-git
301// after calling the Reindex method

Callers 1

TestPackfileReindexMethod · 0.85

Calls 5

MkdirAllMethod · 0.80
OpenFileMethod · 0.80
JoinMethod · 0.80
CloseMethod · 0.65
SeekMethod · 0.45

Tested by

no test coverage detected