lfs: use an absolute path for smudging

On Windows, paths are limited to 260 characters with two exceptions:
manifested applications on Windows 10 may use long path, and all systems
may use UNC paths, which must be absolute. Since we are not currently
using a manifest, use an absolute path when smudging to make so that we
can take advantage of UNC paths on Windows.
This commit is contained in:
brian m. carlson 2019-08-16 15:12:36 +00:00
parent f758e67390
commit 8607cd4951
No known key found for this signature in database
GPG Key ID: 2D0C9BC12F82B3A1

@ -28,7 +28,12 @@ func (f *GitFilter) SmudgeToFile(filename string, ptr *Pointer, download bool, m
defer os.Chmod(filename, stat.Mode())
}
file, err := os.Create(filename)
abs, err := filepath.Abs(filename)
if err != nil {
return fmt.Errorf("Could not produce absolute path for %q", filename)
}
file, err := os.Create(abs)
if err != nil {
return fmt.Errorf("Could not create working directory file: %v", err)
}