Support lossless serialization for Git dependencies in lockfile (#3630)

## Summary

This PR adds lossless deserialization for `GitSourceDist` distributions
in the lockfile. Specifically, we now properly preserve the requested
revision, the subdirectory, and the precise Git commit SHA.

## Test Plan

`cargo test`
This commit is contained in:
Charlie Marsh 2024-05-17 17:23:40 -04:00 committed by GitHub
parent 0f67a6ceea
commit 0d512be46c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 182 additions and 30 deletions

View file

@ -1,7 +1,7 @@
use std::str::FromStr;
/// A complete Git SHA, i.e., a 40-character hexadecimal representation of a Git commit.
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct GitSha(git2::Oid);
impl GitSha {