-
-
Notifications
You must be signed in to change notification settings - Fork 302
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[commitgraph] Stub out commit-graph-verify plumbing command.
Commit graphs are optional, so commit-graph plumbing is guarded by a `commitgraph` feature that is enabled by default.
- Loading branch information
1 parent
98c1360
commit 8db5e51
Showing
10 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod verify; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
use anyhow::{Context as AnyhowContext, Result}; | ||
use std::{io, path::Path}; | ||
|
||
/// A general purpose context for many operations provided here | ||
pub struct Context<W1: io::Write, W2: io::Write> { | ||
/// A stream to which to output operation results | ||
pub out: W1, | ||
/// A stream to which to errors | ||
pub err: W2, | ||
} | ||
|
||
impl Default for Context<Vec<u8>, Vec<u8>> { | ||
fn default() -> Self { | ||
Context { | ||
out: Vec::new(), | ||
err: Vec::new(), | ||
} | ||
} | ||
} | ||
|
||
pub fn graph_or_file<W1, W2>( | ||
path: impl AsRef<Path>, | ||
Context { | ||
out: mut _out, | ||
err: mut _err, | ||
}: Context<W1, W2>, | ||
) -> Result<()> | ||
where | ||
W1: io::Write, | ||
W2: io::Write, | ||
{ | ||
// TODO: Handle `path` being objects/info, objects/info/commit-graph, | ||
// or objects/info/commit-graphs/graph-xyz.graph. | ||
let _g = git_commitgraph::Graph::from_info_dir(path).with_context(|| "Could not open commit graph")?; | ||
Err(anyhow::Error::msg("not implemented")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters