@@ -110,6 +110,12 @@ type Downloader interface {
110110 // Returns the branch that contains the YAML control files; this option
111111 // allows implementers to override "master" as the main branch.
112112 MainBranch () string
113+
114+ // Returns formatted string with repo details
115+ String () string
116+
117+ // Returns if repository was already fetched
118+ IsFetched () bool
113119}
114120
115121type Commit struct {
@@ -814,6 +820,10 @@ func (gd *GenericDownloader) LatestRc(path string,
814820 return bestStr , nil
815821}
816822
823+ func (gd * GenericDownloader ) IsFetched () bool {
824+ return gd .fetched
825+ }
826+
817827func (gd * GithubDownloader ) Fetch (repoDir string ) error {
818828 return gd .cachedFetch (func () error {
819829 util .StatusMessage (util .VERBOSITY_VERBOSE , "Fetching repo %s\n " ,
@@ -921,11 +931,7 @@ func (gd *GithubDownloader) setRemoteAuth(path string) error {
921931func (gd * GithubDownloader ) Clone (commit string , dstPath string ) error {
922932 branch := gd .MainBranch ()
923933
924- url , publicUrl := gd .remoteUrls ()
925-
926- util .StatusMessage (util .VERBOSITY_DEFAULT ,
927- "Downloading repository %s (commit: %s) from %s\n " ,
928- gd .Repo , commit , publicUrl )
934+ url , _ := gd .remoteUrls ()
929935
930936 gp , err := gitPath ()
931937 if err != nil {
@@ -960,6 +966,8 @@ func (gd *GithubDownloader) Clone(commit string, dstPath string) error {
960966 return err
961967 }
962968
969+ gd .fetched = true
970+
963971 return nil
964972}
965973
@@ -987,6 +995,12 @@ func (gd *GithubDownloader) MainBranch() string {
987995 }
988996}
989997
998+ func (gd * GithubDownloader ) String () string {
999+ _ , publicUrl := gd .remoteUrls ()
1000+
1001+ return publicUrl
1002+ }
1003+
9901004func NewGithubDownloader () * GithubDownloader {
9911005 return & GithubDownloader {}
9921006}
@@ -1024,9 +1038,6 @@ func (gd *GitDownloader) FetchFile(
10241038func (gd * GitDownloader ) Clone (commit string , dstPath string ) error {
10251039 branch := gd .MainBranch ()
10261040
1027- util .StatusMessage (util .VERBOSITY_DEFAULT ,
1028- "Downloading repository %s (commit: %s)\n " , gd .Url , commit )
1029-
10301041 gp , err := gitPath ()
10311042 if err != nil {
10321043 return err
@@ -1059,6 +1070,8 @@ func (gd *GitDownloader) Clone(commit string, dstPath string) error {
10591070 return err
10601071 }
10611072
1073+ gd .fetched = true
1074+
10621075 return nil
10631076}
10641077
@@ -1084,6 +1097,10 @@ func (gd *GitDownloader) MainBranch() string {
10841097 }
10851098}
10861099
1100+ func (gd * GitDownloader ) String () string {
1101+ return gd .Url
1102+ }
1103+
10871104func NewGitDownloader () * GitDownloader {
10881105 return & GitDownloader {}
10891106}
@@ -1118,9 +1135,6 @@ func (ld *LocalDownloader) Checkout(path string, commit string) error {
11181135}
11191136
11201137func (ld * LocalDownloader ) Clone (commit string , dstPath string ) error {
1121- util .StatusMessage (util .VERBOSITY_DEFAULT ,
1122- "Downloading local repository %s\n " , ld .Path )
1123-
11241138 if err := util .CopyDir (ld .Path , dstPath ); err != nil {
11251139 return err
11261140 }
@@ -1140,6 +1154,10 @@ func (gd *LocalDownloader) MainBranch() string {
11401154 return "master"
11411155}
11421156
1157+ func (ld * LocalDownloader ) String () string {
1158+ return ld .Path
1159+ }
1160+
11431161func NewLocalDownloader () * LocalDownloader {
11441162 return & LocalDownloader {}
11451163}
0 commit comments