func (a *basicDownloadAdapter) tempDir() string {
	// Must be dedicated to this adapter as deleted by ClearTempStorage
	// Also make local to this repo not global, and separate to localstorage temp,
	// which gets cleared at the end of every invocation
	d := filepath.Join(localstorage.Objects().RootDir, "incomplete")
	if err := os.MkdirAll(d, 0755); err != nil {
		return os.TempDir()
	}
	return d
}
示例#2
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
func ObjectExistsOfSize(oid string, size int64) bool {
	path := localstorage.Objects().ObjectPath(oid)
	return tools.FileExistsOfSize(path, size)
}
示例#3
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
func LocalMediaPath(oid string) (string, error) {
	return localstorage.Objects().BuildObjectPath(oid)
}
示例#4
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
func LocalMediaPathReadOnly(oid string) string {
	return localstorage.Objects().ObjectPath(oid)
}
示例#5
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
func LocalObjectTempDir() string {
	if localstorage.Objects() != nil {
		return localstorage.Objects().TempDir
	}
	return ""
}
示例#6
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
// LocalMediaDir returns the root of lfs objects
func LocalMediaDir() string {
	if localstorage.Objects() != nil {
		return localstorage.Objects().RootDir
	}
	return ""
}
示例#7
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
// only used in tests
func AllObjects() []localstorage.Object {
	return localstorage.Objects().AllObjects()
}
示例#8
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
func ScanObjectsChan() <-chan localstorage.Object {
	return localstorage.Objects().ScanObjectsChan()
}
示例#9
0
文件: lfs.go 项目: zhaohaiyi/git-lfs
func ClearTempObjects() error {
	if localstorage.Objects() == nil {
		return nil
	}
	return localstorage.Objects().ClearTempObjects()
}