Place incomplete downloads under .git/lfs/objects/incomplete

This commit is contained in:
Steve Streeting 2016-06-07 12:15:06 +01:00
parent c9c457c270
commit 9e12668dd9

@ -8,6 +8,8 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/github/git-lfs/localstorage"
"github.com/rubyist/tracerx" "github.com/rubyist/tracerx"
"github.com/github/git-lfs/errutil" "github.com/github/git-lfs/errutil"
@ -30,7 +32,9 @@ func (a *httpRangeAdapter) ClearTempStorage() error {
func (a *httpRangeAdapter) tempDir() string { func (a *httpRangeAdapter) tempDir() string {
// Must be dedicated to this adapter as deleted by ClearTempStorage // Must be dedicated to this adapter as deleted by ClearTempStorage
d := filepath.Join(os.TempDir(), "git-lfs-http-range-temp") // 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 { if err := os.MkdirAll(d, 0755); err != nil {
return os.TempDir() return os.TempDir()
} }