File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ fn process_commit(
169169 filter : & Filter ,
170170) -> Result < git2:: Oid , git2:: Error > {
171171 // Don't bother if it has already been done.
172- if let Some ( & Some ( newid) ) = map. get ( & id) {
172+ if let Some ( & Some ( newid) ) = map. resolve ( & id) {
173173 return Ok ( newid) ;
174174 }
175175
Original file line number Diff line number Diff line change @@ -108,8 +108,10 @@ impl OidMap {
108108 for ( k, v) in & self . map {
109109 write ! ( f, "{}" , k) ?;
110110
111- if let Some ( v) = * v {
111+ if let Some ( v) = v {
112112 write ! ( f, " {}\n " , v) ?;
113+ } else {
114+ write ! ( f, "\n " ) ?;
113115 }
114116 }
115117
@@ -123,9 +125,10 @@ impl OidMap {
123125 /// Resolves an OID through multiple indirections.
124126 pub fn resolve ( & self , k : & Oid ) -> Option < & Option < Oid > > {
125127 match self . map . get ( k) {
126- Some ( value) => match * value {
128+ Some ( value) => match value {
127129 Some ( oid) => {
128- if k == & oid {
130+ if k == oid {
131+ // Break cycles.
129132 Some ( value)
130133 } else if self . map . contains_key ( & oid) {
131134 self . resolve ( & oid)
You can’t perform that action at this time.
0 commit comments