16
16
ErrNoNearestVCS = errors .New ("could not find nearest VCS repository in directory" )
17
17
)
18
18
19
- // VCSIn returns the type of VCS repository rooted at a directory, or
19
+ // In returns the type of VCS repository rooted at a directory, or
20
20
// ErrNoVCSInDir if none is found.
21
- func vcsIn (dirname string ) (VCS , error ) {
21
+ func In (dirname string ) (VCS , error ) {
22
22
for _ , vcs := range Types {
23
23
ok , err := files .ExistsFolder (filepath .Join (dirname , MetadataFolder (vcs )))
24
24
if err != nil {
@@ -31,12 +31,12 @@ func vcsIn(dirname string) (VCS, error) {
31
31
return 0 , ErrNoVCSInDir
32
32
}
33
33
34
- // NearestVCS returns the type and directory of the nearest VCS repository
34
+ // Nearest returns the type and directory of the nearest VCS repository
35
35
// containing the directory, or ErrNoNearestVCS if none is found.
36
- func NearestVCS (dirname string ) (VCS , string , error ) {
36
+ func Nearest (dirname string ) (VCS , string , error ) {
37
37
var vcs VCS
38
38
dir , err := files .WalkUp (dirname , func (d string ) error {
39
- tool , err := vcsIn (d )
39
+ tool , err := In (d )
40
40
if err == ErrNoVCSInDir {
41
41
return nil
42
42
}
@@ -56,7 +56,7 @@ func NearestVCS(dirname string) (VCS, string, error) {
56
56
// errutil.ErrRepositoryNotFound if none is found, or errutil.ErrNotImplemented
57
57
// if an unsupported VCS is found.
58
58
func GetRepository (dirname string ) (string , error ) {
59
- vcs , dir , err := NearestVCS (dirname )
59
+ vcs , dir , err := Nearest (dirname )
60
60
if err == ErrNoNearestVCS {
61
61
return "" , errutil .ErrRepositoryNotFound
62
62
}
0 commit comments