662a624819
Testing showed that while race condition analysis in #3880 was correct, the way it tries to fix that does not work for the *first* git-lfs process that will actually perform file move. Instead, this commit performs multiple attempts when working with files in LFS storage. Similar logic is already implemented in "cmd/go/internal/robustio" and "cmd/go/internal/renameio" packages. However, they are not public, so we cannot use them.
14 lines
211 B
Go
14 lines
211 B
Go
// +build !windows
|
|
|
|
package tools
|
|
|
|
import "os"
|
|
|
|
func RobustRename(oldpath, newpath string) error {
|
|
return os.Rename(oldpath, newpath)
|
|
}
|
|
|
|
func RobustOpen(name string) (*os.File, error) {
|
|
return os.Open(name)
|
|
}
|