File tree 2 files changed +7
-4
lines changed
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ fn process_commit(
169
169
filter : & Filter ,
170
170
) -> Result < git2:: Oid , git2:: Error > {
171
171
// 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) {
173
173
return Ok ( newid) ;
174
174
}
175
175
Original file line number Diff line number Diff line change @@ -108,8 +108,10 @@ impl OidMap {
108
108
for ( k, v) in & self . map {
109
109
write ! ( f, "{}" , k) ?;
110
110
111
- if let Some ( v) = * v {
111
+ if let Some ( v) = v {
112
112
write ! ( f, " {}\n " , v) ?;
113
+ } else {
114
+ write ! ( f, "\n " ) ?;
113
115
}
114
116
}
115
117
@@ -123,9 +125,10 @@ impl OidMap {
123
125
/// Resolves an OID through multiple indirections.
124
126
pub fn resolve ( & self , k : & Oid ) -> Option < & Option < Oid > > {
125
127
match self . map . get ( k) {
126
- Some ( value) => match * value {
128
+ Some ( value) => match value {
127
129
Some ( oid) => {
128
- if k == & oid {
130
+ if k == oid {
131
+ // Break cycles.
129
132
Some ( value)
130
133
} else if self . map . contains_key ( & oid) {
131
134
self . resolve ( & oid)
You can’t perform that action at this time.
0 commit comments