File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Original file line number Diff line number Diff line change @@ -41,23 +41,24 @@ func NewFilesystemLoader(base billy.Filesystem, strict bool) Loader {
41
41
// storer for it. Returns transport.ErrRepositoryNotFound if a repository does
42
42
// not exist in the given path.
43
43
func (l * FilesystemLoader ) Load (ep * Endpoint ) (storage.Storer , error ) {
44
- return l .load (ep , false )
44
+ return l .load (ep . Path , false )
45
45
}
46
46
47
- func (l * FilesystemLoader ) load (ep * Endpoint , tried bool ) (storage.Storer , error ) {
48
- fs , err := l .base .Chroot (ep . Path )
47
+ func (l * FilesystemLoader ) load (path string , tried bool ) (storage.Storer , error ) {
48
+ fs , err := l .base .Chroot (path )
49
49
if err != nil {
50
50
return nil , err
51
51
}
52
52
53
53
if _ , err := fs .Stat ("config" ); err != nil {
54
54
if ! l .strict && ! tried {
55
+ tried = true
55
56
if fi , err := fs .Stat (".git" ); err == nil && fi .IsDir () {
56
- ep . Path = filepath .Join (ep . Path , ".git" )
57
+ path = filepath .Join (path , ".git" )
57
58
} else {
58
- ep . Path = ep . Path + ".git"
59
+ path = path + ".git"
59
60
}
60
- return l .load (ep , true )
61
+ return l .load (path , tried )
61
62
}
62
63
return nil , ErrRepositoryNotFound
63
64
}
You can’t perform that action at this time.
0 commit comments