@@ -38,6 +38,7 @@ func (t Trac) String() string {
38
38
39
39
type Cache struct {
40
40
debugf func (fmt string , args ... interface {})
41
+ infof func (fmt string , args ... interface {})
41
42
repoDir string
42
43
repo * git.Repository
43
44
autoexclude bool
@@ -47,9 +48,10 @@ type Cache struct {
47
48
48
49
func NewCache (rdir string , r * git.Repository , excludes []string ,
49
50
autoexclude bool ,
50
- debugf func (fmt string , args ... interface {})) * Cache {
51
+ debugf , infof func (fmt string , args ... interface {})) * Cache {
51
52
c := Cache {
52
53
debugf : debugf ,
54
+ infof : infof ,
53
55
repoDir : rdir ,
54
56
repo : r ,
55
57
autoexclude : autoexclude ,
@@ -93,7 +95,7 @@ func (c *Cache) UpdateBranchRefs() error {
93
95
if strings .HasSuffix (name , ".trac" ) {
94
96
return nil
95
97
}
96
- c .debugf ("Scanning branch: %v\n " , name )
98
+ c .infof ("Scanning branch: %v\n " , name )
97
99
commit , err := c .TracByRef (name )
98
100
if err != nil {
99
101
return err
@@ -110,7 +112,7 @@ func (c *Cache) UpdateBranchRefs() error {
110
112
for i := range branches {
111
113
newname := string (branches [i ].Name ()) + ".trac"
112
114
hash := commits [i ].Hash
113
- c .debugf ("Updating %.10v -> %v\n " , hash , newname )
115
+ c .infof ("Updating %.10v -> %v\n " , hash , newname )
114
116
115
117
refname := plumbing .ReferenceName (newname )
116
118
ref := plumbing .NewHashReference (refname , hash )
@@ -290,7 +292,7 @@ func commitPath(path string, sub int) string {
290
292
}
291
293
292
294
func (c * Cache ) tryFetchFromSubmodules (path string , hash plumbing.Hash ) error {
293
- c .debugf ("Searching submodules for: %v\n " , path )
295
+ c .infof ("Searching submodules for: %v\n " , path )
294
296
wt , err := c .repo .Worktree ()
295
297
if err != nil {
296
298
return fmt .Errorf ("git worktree: %v" , err )
@@ -307,9 +309,10 @@ func (c *Cache) tryFetchFromSubmodules(path string, hash plumbing.Hash) error {
307
309
}
308
310
_ , err = subr .CommitObject (hash )
309
311
if err != nil {
310
- c .debugf (" ...not in %v\n " , subpath )
312
+ c .infof (" ...not in %v\n " , subpath )
311
313
continue
312
314
}
315
+ c .infof (" ...found! in %v\n " , subpath )
313
316
brname := fmt .Sprintf ("subtrac-tmp-%v" , hash )
314
317
brrefname := plumbing .NewBranchReferenceName (brname )
315
318
ref := plumbing .NewHashReference (brrefname , hash )
0 commit comments