| ... | ... | @@ -1137,9 +1137,9 @@ pub const Repository = struct { |
| 1137 | 1137 | if (cache_behavior == .cache) if (r.commits.get(id.id)) |val| { |
| 1138 | 1138 | return .{ id, val }; |
| 1139 | 1139 | }; |
| 1140 | | if (try r.getObject(id.id, .cache)) |obj| { |
| 1140 | if (try r.getObject(id.id, .no_cache)) |obj| { |
| 1141 | 1141 | if (obj.type == .commit) { |
| 1142 | | const raw = try r.gpa.dupe(u8, obj.content); |
| 1142 | const raw = obj.content; |
| 1143 | 1143 | errdefer r.gpa.free(raw); |
| 1144 | 1144 | const commit = try r.gpa.create(Commit); |
| 1145 | 1145 | errdefer r.gpa.destroy(commit); |
| ... | ... | @@ -1147,6 +1147,7 @@ pub const Repository = struct { |
| 1147 | 1147 | if (cache_behavior == .cache) try r.commits.put(r.gpa, id.id, commit); |
| 1148 | 1148 | return .{ id, commit }; |
| 1149 | 1149 | } |
| 1150 | r.gpa.free(obj.content); |
| 1150 | 1151 | } |
| 1151 | 1152 | return null; |
| 1152 | 1153 | } |