diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2023-12-08 20:15:43 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2023-12-08 20:15:43 +0000 |
| commit | 6d3c9218d2d3320f5d7fb9b9ede8750e947b70e8 (patch) | |
| tree | 8b2da4f27c393dec9f01690162cd2705c21d6c26 /src/git.rs | |
| parent | 82bf53ac3c18e15b75852a48b2e5b432c75a5c7f (diff) | |
feat(push) push commits to existing pr
- find pr with a branch-name that matches checked out branch
- check branch isnt behind latest patch on pr
- push new commits a patches associated with pr
Diffstat (limited to 'src/git.rs')
| -rw-r--r-- | src/git.rs | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -384,6 +384,12 @@ fn sha1_to_oid(hash: &Sha1Hash) -> Result<Oid> { | |||
| 384 | Oid::from_bytes(hash.as_byte_array()).context("Sha1Hash bytes failed to produce a valid Oid") | 384 | Oid::from_bytes(hash.as_byte_array()).context("Sha1Hash bytes failed to produce a valid Oid") |
| 385 | } | 385 | } |
| 386 | 386 | ||
| 387 | pub fn str_to_sha1(s: &str) -> Result<Sha1Hash> { | ||
| 388 | Ok(oid_to_sha1( | ||
| 389 | &Oid::from_str(s).context("string is not a sha1 hash")?, | ||
| 390 | )) | ||
| 391 | } | ||
| 392 | |||
| 387 | fn git_sig_to_tag_vec(sig: &git2::Signature) -> Vec<String> { | 393 | fn git_sig_to_tag_vec(sig: &git2::Signature) -> Vec<String> { |
| 388 | vec![ | 394 | vec![ |
| 389 | sig.name().unwrap_or("").to_string(), | 395 | sig.name().unwrap_or("").to_string(), |