Comment revisions per review
This commit is contained in:
parent
7161afeb6c
commit
d1728f8ed5
@ -24,9 +24,9 @@ var (
|
||||
GitCommit string
|
||||
UserAgent string
|
||||
LocalWorkingDir string
|
||||
LocalGitDir string
|
||||
LocalGitDir string // parent of index / config / hooks etc
|
||||
LocalGitStorageDir string // parent of objects/lfs (may be same as LocalGitDir but may not)
|
||||
LocalMediaDir string
|
||||
LocalMediaDir string // root of lfs objects
|
||||
LocalLogDir string
|
||||
checkedTempDir string
|
||||
)
|
||||
@ -104,7 +104,7 @@ func init() {
|
||||
LocalWorkingDir, LocalGitDir, err = resolveGitDir()
|
||||
if err == nil {
|
||||
LocalGitStorageDir = resolveGitStorageDir(LocalGitDir)
|
||||
LocalMediaDir = filepath.Join(LocalGitStorageDir, "lfs", "objects") // objects across all worktrees
|
||||
LocalMediaDir = filepath.Join(LocalGitStorageDir, "lfs", "objects")
|
||||
LocalLogDir = filepath.Join(LocalMediaDir, "logs")
|
||||
TempDir = filepath.Join(LocalGitDir, "lfs", "tmp") // temp files per worktree
|
||||
|
||||
|
@ -276,7 +276,7 @@ func IsWindows() bool {
|
||||
return GetPlatform() == PlatformWindows
|
||||
}
|
||||
|
||||
// Determine if a file/dir exists, returns IsDir() results too
|
||||
// FileOrDirExists determines if a file/dir exists, returns IsDir() results too.
|
||||
func FileOrDirExists(path string) (exists bool, isDir bool) {
|
||||
fi, err := os.Stat(path)
|
||||
if err != nil {
|
||||
@ -286,19 +286,19 @@ func FileOrDirExists(path string) (exists bool, isDir bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// Determine if a file (NOT dir) exists
|
||||
// FileExists determines if a file (NOT dir) exists.
|
||||
func FileExists(path string) bool {
|
||||
ret, isDir := FileOrDirExists(path)
|
||||
return ret && !isDir
|
||||
}
|
||||
|
||||
// Determine if a dir (NOT file) exists
|
||||
// DirExists determines if a dir (NOT file) exists.
|
||||
func DirExists(path string) bool {
|
||||
ret, isDir := FileOrDirExists(path)
|
||||
return ret && isDir
|
||||
}
|
||||
|
||||
// Determine if a file exists and is of a specific size
|
||||
// FileExistsOfSize determines if a file exists and is of a specific size.
|
||||
func FileExistsOfSize(path string, sz int64) bool {
|
||||
fi, err := os.Stat(path)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user