@@ -18,6 +18,7 @@ public class Remote : IEquatable<Remote>
18
18
public List < PktRef > Refs { get ; private set ; }
19
19
private Lazy < IEnumerable < string > > refnames ;
20
20
private Lazy < IEnumerable < string > > matching_refs ;
21
+ private Indexer indexer ;
21
22
22
23
/* Mostly so that the already-existing code doesn't break */
23
24
public Remote ( )
@@ -74,12 +75,22 @@ public void Connect()
74
75
}
75
76
}
76
77
78
+ public IndexerStats Stats
79
+ {
80
+ get {
81
+ return indexer . Stats ;
82
+ }
83
+ }
84
+
77
85
public void Download ( string path )
78
86
{
79
87
Ensure . ArgumentNotNullOrEmptyString ( path , "path" ) ;
80
88
if ( ! Directory . Exists ( path ) )
81
89
Directory . CreateDirectory ( path ) ;
82
90
91
+ var indexer = new Indexer ( path ) ;
92
+ this . indexer = indexer ;
93
+
83
94
/* First, let's see what we want. At this point we don't send any haves */
84
95
Stream stream = new MemoryStream ( ) ;
85
96
var writer = new StreamWriter ( stream ) ;
@@ -107,7 +118,6 @@ public void Download(string path)
107
118
if ( ! ( pkt is PktAck || pkt is PktNak ) )
108
119
throw new GitProtocolException ( "Expected ACK or NAK, got neither" ) ;
109
120
110
- var indexer = new Indexer ( path ) ;
111
121
indexer . IndexStream ( stream ) ;
112
122
}
113
123
0 commit comments