This is a simple attempt at re-creating some of the functionality of the git command in Rust.
Run
cargo runto see the help message.
hash-object- Compute the hash of an object and optionally write it to the object database.-wflag to write the object to the object database.-tflag to specify the type of the object (supported:blob).<file>argument to specify the file to hash.
init- Create an empty Git repository.--bareflag to create a bare repository.-bor--initial-branchflag to specify the initial branch.-qor--quietflag to suppress the output.<directory>argument to specify the directory to initialize.
cat-file- Provide content or type and size information for repository objects.-tflag to show the type of the object.-sflag to show the size of the object.-pflag to show the content of the object (pretty-print)--allow-unknown-typeflag to allow unknown object types (to be used with-tor-s).<object>argument to specify the object to show.
show-ref- List references in a local repository.--headflag to include the HEAD reference.--tagsflag to show only tags.--headsflag to show only heads.--hash=<n>flag to only show the reference hashes (nis the number of characters to show, 4-40).--abbrev=<n>flag to abbreviate the hashes toncharacters (4-40)
Due to the nature of the project, tests must be run single-threaded. This is enforced by the RUST_TEST_THREADS=1 environment variable in the .cargo/config.toml file.
To run the tests, use the following command:
cargo test