Merge branch 'panic-fix' of https://github.com/michael-k/git-lfs into michael-k-panic-fix

This commit is contained in:
Rick Olson 2015-05-21 11:44:46 -06:00
commit d71ad5bec5

@ -160,7 +160,16 @@ func processDotGitFile(file string) (string, string, error) {
wd, _ := os.Getwd()
if strings.HasPrefix(contents, gitPtrPrefix) {
dir := strings.TrimSpace(strings.Split(contents, gitPtrPrefix)[1])
absDir, _ := filepath.Abs(dir)
if filepath.IsAbs(dir) {
// The .git file contains an absolute path.
return wd, dir, nil
}
// The .git file contains a relative path.
// Create an absolute path based on the directory the .git file is located in.
absDir := filepath.Join(filepath.Dir(file), dir)
return wd, absDir, nil
}