Comment revisions per review

This commit is contained in:
Steve Streeting 2015-07-31 16:38:09 +01:00
parent 7161afeb6c
commit d1728f8ed5
2 changed files with 7 additions and 7 deletions

@ -24,9 +24,9 @@ var (
GitCommit string GitCommit string
UserAgent string UserAgent string
LocalWorkingDir 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) LocalGitStorageDir string // parent of objects/lfs (may be same as LocalGitDir but may not)
LocalMediaDir string LocalMediaDir string // root of lfs objects
LocalLogDir string LocalLogDir string
checkedTempDir string checkedTempDir string
) )
@ -104,7 +104,7 @@ func init() {
LocalWorkingDir, LocalGitDir, err = resolveGitDir() LocalWorkingDir, LocalGitDir, err = resolveGitDir()
if err == nil { if err == nil {
LocalGitStorageDir = resolveGitStorageDir(LocalGitDir) LocalGitStorageDir = resolveGitStorageDir(LocalGitDir)
LocalMediaDir = filepath.Join(LocalGitStorageDir, "lfs", "objects") // objects across all worktrees LocalMediaDir = filepath.Join(LocalGitStorageDir, "lfs", "objects")
LocalLogDir = filepath.Join(LocalMediaDir, "logs") LocalLogDir = filepath.Join(LocalMediaDir, "logs")
TempDir = filepath.Join(LocalGitDir, "lfs", "tmp") // temp files per worktree TempDir = filepath.Join(LocalGitDir, "lfs", "tmp") // temp files per worktree

@ -276,7 +276,7 @@ func IsWindows() bool {
return GetPlatform() == PlatformWindows 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) { func FileOrDirExists(path string) (exists bool, isDir bool) {
fi, err := os.Stat(path) fi, err := os.Stat(path)
if err != nil { 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 { func FileExists(path string) bool {
ret, isDir := FileOrDirExists(path) ret, isDir := FileOrDirExists(path)
return ret && !isDir return ret && !isDir
} }
// Determine if a dir (NOT file) exists // DirExists determines if a dir (NOT file) exists.
func DirExists(path string) bool { func DirExists(path string) bool {
ret, isDir := FileOrDirExists(path) ret, isDir := FileOrDirExists(path)
return ret && isDir 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 { func FileExistsOfSize(path string, sz int64) bool {
fi, err := os.Stat(path) fi, err := os.Stat(path)