Skip to content

Commit

Permalink
frame for git-chunk crate to share among git-pack and git-commitgraph (
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Dec 20, 2021
1 parent edf02ae commit b2d2ae2
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 2 deletions.
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ members = [
"git-config",
"git-features",
"git-commitgraph",
"git-chunk",
"git-object",
"git-diff",
"git-traverse",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Follow linked crate name for detailed status. Please note that all crates follow
* **usable**
* [git-actor](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-actor)
* [git-hash](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-hash)
* [git-chunk](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-chunk)
* [git-object](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-object)
* [git-validate](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-validate)
* [git-url](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-url)
Expand Down
4 changes: 4 additions & 0 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
* [x] API documentation
* [ ] Some examples

### git-chunk
* [ ] decode the chunk file table of contents and provide convenient API
* [ ] write the table of contents

### git-object
* *decode (zero-copy)* borrowed objects
* [x] commit
Expand Down
9 changes: 9 additions & 0 deletions git-chunk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

22 changes: 22 additions & 0 deletions git-chunk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[package]
name = "git-chunk"
version = "0.0.0"
description = "Interact with the git chunk file format used in multi-pack index and commit-graph files"
authors = ["Sebastian Thiel <[email protected]>"]
repository = "https://github.com/Byron/gitoxide"
documentation = "https://github.com/git/git/blob/seen/Documentation/technical/chunk-format.txt"
license = "MIT/Apache-2.0"
edition = "2018"
include = ["src/**/*", "CHANGELOG.md"]

[lib]
doctest = false
test = false

[dependencies]
quick-error = "2.0.0"
hex = "0.4.2"

[dev-dependencies]
git-testtools = { path = "../tests/tools"}

5 changes: 5 additions & 0 deletions git-chunk/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//! Low-level access to reading and writing chunk file based formats.
//!
//! See the [git documentation](https://github.com/git/git/blob/seen/Documentation/technical/chunk-format.txt) for details.
#![deny(unsafe_code)]
#![deny(rust_2018_idioms, missing_docs)]
2 changes: 2 additions & 0 deletions git-chunk/tests/chunk/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#[test]
fn it_works() {}
1 change: 1 addition & 0 deletions git-chunk/tests/integration.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod chunk;
4 changes: 2 additions & 2 deletions git-pack/src/multi_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ pub mod access {
///
pub mod init {
use crate::multi_index::{File, Version};
use byteorder::{BigEndian, ByteOrder};
use byteorder::{BigEndian, ByteOrder, ReadBytesExt};
use filebuffer::FileBuffer;
use std::convert::TryFrom;
use std::convert::{TryFrom, TryInto};
use std::path::Path;

mod error {
Expand Down

0 comments on commit b2d2ae2

Please sign in to comment.