Showing the changes to git-ref/src/store (2 of 3 files). Show all
Unified · Split
| @@ -102,7 +102,7 @@ impl<'a> Transaction<'a> { · 101 unmodified lines | |||
| 102 | 102 | ||
| 103 | // Keep the previous value for the caller and ourselves. Maybe they want to keep a log of sorts. | 103 | // Keep the previous value for the caller and ourselves. Maybe they want to keep a log of sorts. |
| 104 | if let Some(existing) = existing_ref { | 104 | if let Some(existing) = existing_ref { |
| 105 | *previous = Some(existing.target.into()); | 105 | *previous = Some(existing.target); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | lock | 108 | lock |
| @@ -165,7 +165,7 @@ impl<'a> Transaction<'a> { · 56 unmodified lines | |||
| 165 | *previous = match existing_ref { | 165 | *previous = match existing_ref { |
| 166 | None => Create::Only, | 166 | None => Create::Only, |
| 167 | Some(existing) => Create::OrUpdate { | 167 | Some(existing) => Create::OrUpdate { |
| 168 | previous: Some(existing.target.into()), | 168 | previous: Some(existing.target), |
| 169 | }, | 169 | }, |
| 170 | }; | 170 | }; |
| 171 | 171 | ||
| @@ -73,7 +73,7 @@ pub fn reference<'a, E: ParseError<&'a [u8]> + FromExternalError<&'a [u8], crate · 72 unmodified lines | |||
| 73 | ) -> IResult<&'a [u8], packed::Reference<'a>, E> { | 73 | ) -> IResult<&'a [u8], packed::Reference<'a>, E> { |
| 74 | let (input, (target, name)) = tuple(( | 74 | let (input, (target, name)) = tuple(( |
| 75 | terminated(hex_hash, tag(b" ")), | 75 | terminated(hex_hash, tag(b" ")), |
| 76 | map_res(until_newline, |name| crate::FullName::try_from(name)), | 76 | map_res(until_newline, crate::FullName::try_from), |
| 77 | ))(input)?; | 77 | ))(input)?; |
| 78 | let (rest, object) = opt(delimited(tag(b"^"), hex_hash, newline))(input)?; | 78 | let (rest, object) = opt(delimited(tag(b"^"), hex_hash, newline))(input)?; |
| 79 | Ok((rest, packed::Reference { name, target, object })) | 79 | Ok((rest, packed::Reference { name, target, object })) |