Harness the power of signify(1) to sign arbitrary git objects
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

parse revision

+9 -5
+9 -5
src/main.rs
··· 67 67 fn verify(key_path: PathBuf, recover: bool, oid: String) -> Result<()> { 68 68 let repo = Repository::open(".").context("Failed to open git repository")?; 69 69 70 - let oid = Oid::from_str(&oid).context("Failed to parse git tree oid")?; 70 + let oid = repo 71 + .revparse_single(&oid) 72 + .context("Failed to look-up git tree oid")? 73 + .id(); 71 74 let tree = repo 72 75 .find_tree(oid) 73 - .context("Failed to look-up tree oid in the repository")?; 76 + .context("No tree object found for the given revision")?; 74 77 75 78 let object = tree 76 79 .get_name("object") ··· 114 117 fn sign(key_path: PathBuf, oid: String) -> Result<()> { 115 118 let repo = Repository::open(".").context("Failed to open git repository")?; 116 119 117 - let oid = Oid::from_str(&oid).context("Failed to parse git object id")?; 118 - repo.find_object(oid, None) 119 - .context("Failed to look-up object in the repository")?; 120 + let oid = repo 121 + .revparse_single(&oid) 122 + .context("Failed to look-up git object id")? 123 + .id(); 120 124 121 125 let object_blob = repo 122 126 .blob(oid.as_bytes())