aboutsummaryrefslogtreecommitdiffstats
path: root/repository.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository.go')
-rw-r--r--repository.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/repository.go b/repository.go
index 9dd35be..d954333 100644
--- a/repository.go
+++ b/repository.go
@@ -278,6 +278,14 @@ func dotGitToOSFilesystems(path string, detect bool) (dot, wt billy.Filesystem,
if path, err = filepath.Abs(path); err != nil {
return nil, nil, err
}
+
+ pathinfo, err := os.Stat(path)
+ if !os.IsNotExist(err) {
+ if !pathinfo.IsDir() {
+ path = filepath.Dir(path)
+ }
+ }
+
var fs billy.Filesystem
var fi os.FileInfo
for {