-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorganize crates to make 'gitoxide' the CLI, and 'gitoxide-core' the…
… library The latter at least doesn't have to pull in CLI stuff, and allows people to more easily reuse all functionality of gitoxide.
- Loading branch information
Showing
6 changed files
with
51 additions
and
27 deletions.
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,13 @@ | ||
[package] | ||
name = "gitoxide-core" | ||
description = "The library implementating all capabilities of the gitoxide CLI" | ||
version = "0.1.0" | ||
authors = ["Sebastian Thiel <[email protected]>"] | ||
publish = false | ||
license = "MIT" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
git-repository = { version = "0.1.0", path = "../git-repository" } | ||
git-odb = { version = "0.1.0", path = "../git-odb", default-features = false, features = ["fast-sha1"] } | ||
anyhow = "1.0.31" |
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,13 @@ | ||
use anyhow::{Context, Result}; | ||
use std::{io, path::Path}; | ||
|
||
pub fn init() -> Result<()> { | ||
git_repository::init::repository().with_context(|| "Repository initialization failed") | ||
} | ||
|
||
pub fn verify_pack_or_pack_index(path: impl AsRef<Path>, mut out: impl io::Write) -> Result<()> { | ||
let pack = git_odb::pack::File::at(path).with_context(|| "Could not open pack file")?; | ||
pack.verify_checksum().with_context(|| "Failed")?; | ||
writeln!(out, "OK")?; | ||
Ok(()) | ||
} |
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