Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
d370a93
Initial commit
genedna Sep 25, 2025
dd93c68
init codebase
yyk808 Sep 25, 2025
61ea185
Merge pull request #1 from yyk808/main
genedna Sep 26, 2025
d727c76
fix: mercury compilation
yyk808 Sep 26, 2025
afc1c18
chore: set MIT license
yyk808 Sep 27, 2025
905fa44
chore: specify dependencies' version
yyk808 Sep 27, 2025
1271d0b
fix publish requirements
yyk808 Sep 27, 2025
270320c
fix: change name to git-internal
yyk808 Sep 27, 2025
d7213a8
Merge pull request #2 from yyk808/main
genedna Sep 27, 2025
802c32c
Fix tests case
genedna Sep 28, 2025
70470dd
Fix with Copilot suggestions
genedna Sep 28, 2025
a2a4292
Merge pull request #3 from genedna/main
genedna Sep 28, 2025
aa8ebb3
Fix all test cases, add files for test cases in LFS (#4)
genedna Sep 28, 2025
6465d0c
Add r2cn issue template (#5)
genedna Sep 29, 2025
d1877e0
add .devcontainer
genedna Oct 2, 2025
e30558a
Update name of devcontainer
genedna Oct 2, 2025
1673bc5
feat: Implement Git Note object parsing and generation (#8)
AllureCurtain Oct 2, 2025
a4128b4
Merge pull request #9 from genedna/main
benjamin-747 Oct 2, 2025
fbab56c
Add dependabot config and update issue templates
genedna Oct 12, 2025
e3ebc74
Apply suggestion from @Copilot
genedna Oct 12, 2025
f522496
Update src/errors.rs
genedna Oct 12, 2025
5a82c5d
Merge pull request #11 from genedna/main
benjamin-747 Oct 13, 2025
e181cf7
feat: Abstract HTTP and SSH protocal from mega to git-internal
AllureCurtain Oct 18, 2025
ee6334c
refactor: Address review feedback for protocol
AllureCurtain Oct 20, 2025
9337d5b
fix: fix error about HTTP and SSH abstract
AllureCurtain Oct 24, 2025
88e4813
Merge pull request #12 from AllureCurtain/feat/protocal
benjamin-747 Oct 24, 2025
772b4b3
docs: Update GIT_PROTOCOL_GUIDE.md (#15)
AllureCurtain Oct 25, 2025
e605918
Add copilot-instructions.md for GitHub copilot (#16)
genedna Oct 25, 2025
8c95a45
Update git protocol doc and reformat core.rs
genedna Oct 27, 2025
8af9943
Merge pull request #17 from genedna/main
benjamin-747 Oct 27, 2025
7260073
build: migrate git-internal to buck2 using cargo-buckal (#18)
jjl9807 Oct 30, 2025
d56eb4b
ci: fix LFS support in checkout step for test job (#19)
jjl9807 Oct 30, 2025
84f6fed
feat: add metadata to entry object && use meta data in magic sort (#21)
pleasedontbreak123 Nov 4, 2025
5905ac2
feat: Implement a line-level diff tool based on the Myers algorithm
231220075 Nov 12, 2025
4491e06
fix tempfile version
231220075 Nov 12, 2025
938ee01
build: resolve buck2 failure
jjl9807 Nov 13, 2025
b22dc2b
fix: rm async keyword && adjust diff-test
231220075 Nov 13, 2025
333c87d
Merge pull request #22 from 231220075/main
benjamin-747 Nov 14, 2025
dc6b0c7
build(deps): bump hyper from 1.8.0 to 1.8.1 (#23)
dependabot[bot] Nov 16, 2025
b2a4d17
build(deps): bump bytes from 1.10.1 to 1.11.0 (#25)
dependabot[bot] Nov 18, 2025
93b0968
build(deps): bump axum from 0.8.6 to 0.8.7 (#24)
dependabot[bot] Nov 18, 2025
1c42e47
adjust diff for code-blame
231220075 Nov 18, 2025
ad9b6dd
Merge pull request #26 from 231220075/main
benjamin-747 Nov 19, 2025
bff71d9
feat: update cargo.toml package version (#27)
benjamin-747 Nov 19, 2025
2e44b93
docs: add SHA-256 hash computation analysis report (#30)
jackieismpc Nov 23, 2025
e046aa9
build(deps): bump http from 1.3.1 to 1.4.0 (#32)
dependabot[bot] Nov 25, 2025
6e3be96
Feat/multi hash support (#33)
jackieismpc Nov 28, 2025
dbe1606
build(deps): bump tracing from 0.1.41 to 0.1.43 (#35)
dependabot[bot] Nov 28, 2025
0dfc4e1
build(deps): bump tracing-subscriber from 0.3.20 to 0.3.22 (#34)
dependabot[bot] Nov 29, 2025
a5fb6a2
build: update third-party deps and migrate tests to Buck2 (#36)
jjl9807 Nov 29, 2025
0df940e
Update library name
genedna Nov 29, 2025
1fb6afd
Merge pull request #37 from genedna/main
benjamin-747 Dec 2, 2025
ad51124
chore: remove unused crates identified by cargo-udeps (#38)
slow2342 Dec 2, 2025
eef5cae
bump to 0.3.0 and cleanup the Cargo.toml and Buck2 files (#39)
genedna Dec 2, 2025
a5f24b3
build(deps): bump uuid from 1.18.1 to 1.19.0 (#40)
dependabot[bot] Dec 3, 2025
9ac5c54
Create codeql.yml
genedna Dec 3, 2025
22a5897
build(deps): bump libc from 0.2.177 to 0.2.178 (#41)
dependabot[bot] Dec 3, 2025
5567134
build: migrate BUCK files (#42)
jjl9807 Dec 5, 2025
7a5a2d0
Upgrade flate2 to 1.1.7 (#44)
genedna Dec 5, 2025
3bb3073
feat:Build an IDX file generator and wraps a PackEncoder to provide b…
pleasedontbreak123 Dec 11, 2025
2812de8
feat: build .idx files in decode and fix pack decode bugsFeat/update …
jackieismpc Dec 12, 2025
a90878b
Update base.yml (#47)
genedna Dec 13, 2025
6b71fa4
Update base.yml (#50)
genedna Dec 15, 2025
08d0d12
use new pack file (#49)
jackieismpc Dec 15, 2025
65af5f0
Fmt use as group and add file comment (#51)
genedna Dec 15, 2025
ac32a65
Docs/update docs (#53)
jackieismpc Dec 19, 2025
102ce4b
Upgrade tracing to 0.1.44 (#56)
genedna Dec 20, 2025
23f7fbb
refining function-level doc comments (#54)
jackieismpc Dec 21, 2025
4447e3d
update some tests and docs (#57)
jackieismpc Dec 24, 2025
5aea9ef
Upgrade axum and tempfile (#60)
genedna Dec 24, 2025
a1a87c8
feat: add Git server over HTTP & SSH and fix protocol handling (#61)
jackieismpc Dec 29, 2025
c19876f
Upgrade 0.4.0 (#62)
genedna Dec 29, 2025
a8adb06
fix(encode): 32-bit safe pack header check (#64)
yueneiqi Jan 4, 2026
a47bbb6
fix: use temp dir in index file test (#66)
yueneiqi Jan 4, 2026
90daceb
fix(encode): adjust max pack size for 32-bit targets to prevent overf…
yueneiqi Jan 5, 2026
1c53ca2
Upgrade some crates (#71)
genedna Jan 6, 2026
9944119
Potential fix for code scanning alert no. 7: Workflow does not contai…
genedna Jan 6, 2026
fcf23f6
build(deps): bump rsa in the cargo group across 1 directory (#73)
dependabot[bot] Jan 8, 2026
17b96c7
feat(action): Add claude action (#76)
genedna Jan 13, 2026
6a07804
Improve claude review action (#77)
genedna Jan 15, 2026
3a03863
Potential fix for code scanning alert no. 11: Code injection
genedna Jan 15, 2026
5ae34de
Improve codeql action (#78)
genedna Jan 15, 2026
581feb3
Upgrade colored and thiserror (#82)
genedna Jan 19, 2026
096151b
Upgrade the buck2 support with newest buckal (#83)
genedna Jan 21, 2026
c90c8d4
AI Process Objects (#90)
jackieismpc Feb 11, 2026
1db0293
Update objects of agent flow (#91)
genedna Feb 12, 2026
500843b
Bump version to 0.5.0 (#92)
genedna Feb 12, 2026
19f962f
Apply AI object and context fixes (#98)
genedna Feb 17, 2026
bd44365
ai-objects: comprehensive documentation, invariants, and pack boundar…
genedna Feb 20, 2026
de0253c
Fix Claude Review error (#100)
genedna Feb 21, 2026
0caa69b
Upgrade crates (#101)
genedna Feb 23, 2026
665ed69
chore: bump rand to 0.10.0 (#103)
jjl9807 Feb 27, 2026
755a5c9
Bump to 0.6.1 (#105)
genedna Feb 27, 2026
cf77780
Bump to 0.6.1 (#106)
genedna Feb 27, 2026
258677f
chore: bump chrono to 0.4.44 and uuid to 1.21.0 (#108)
yueneiqi Mar 5, 2026
65b910d
Bump to 0.7.0 (#109)
genedna Mar 7, 2026
b350e04
Upgrade some crates (#116)
genedna Mar 13, 2026
53f1c55
Replace bincode with rkyv 0.8.15 (#117)
genedna Mar 13, 2026
e87e185
build(deps): bump time in the cargo group across 1 directory (#118)
dependabot[bot] Mar 13, 2026
6e92e2e
Bump to 0.7.1 (#119)
genedna Mar 13, 2026
f62bd29
Bump to 0.7.2 (#120)
genedna Mar 13, 2026
5747f2c
bump to 0.7.3 (#121)
genedna Mar 13, 2026
5a16108
refactor(pack): extract helper functions from encode.rs to improve te…
p05-HY May 28, 2026
fe7d454
Merge branch 'main' into fix/split-Encode
p05-HY May 28, 2026
61d0a71
fix: resolve clippy warnings
p05-HY May 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tests/data/packs/* filter=lfs diff=lfs merge=lfs -text
*.pack filter=lfs diff=lfs merge=lfs -text
20de184187340e8b98da0fa14685b6a3e5c638ba2cf6b7b193b17c0ee1da38e8 filter=lfs diff=lfs merge=lfs -text
80 changes: 0 additions & 80 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ tokio-util = { version = "0.7.18", features = ["io"] }
quickcheck = "1.1.0"
rand = "0.10.0"
chacha20 = "0.10.0"
ureq = "3"

[features]
default = ["diff_mydrs"]
Expand Down
13 changes: 7 additions & 6 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,13 @@ pub fn set_hash_kind_for_test(kind: HashKind) -> HashKindGuard {
mod tests {

use std::{
env,
io::{BufReader, Read, Seek, SeekFrom},
path::PathBuf,
str::FromStr,
};

use crate::{
hash::{HashKind, ObjectHash, set_hash_kind_for_test},
internal::pack::test_pack_download::download_pack_file,
};
use crate::hash::{HashKind, ObjectHash, set_hash_kind_for_test};

/// Hashing "Hello, world!" with SHA1 should match known value.
#[test]
Expand Down Expand Up @@ -329,7 +328,8 @@ mod tests {
#[test]
fn test_signature_without_delta() {
let _guard = set_hash_kind_for_test(HashKind::Sha1);
let (source, _dl_guard) = download_pack_file("small-sha1.pack");
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push("tests/data/packs/small-sha1.pack");

let f = std::fs::File::open(source).unwrap();
let mut buffered = BufReader::new(f);
Expand All @@ -345,7 +345,8 @@ mod tests {
#[test]
fn test_signature_without_delta_sha256() {
let _guard = set_hash_kind_for_test(HashKind::Sha256);
let (source, _dl_guard) = download_pack_file("small-sha256.pack");
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push("tests/data/packs/small-sha256.pack");

let f = std::fs::File::open(source).unwrap();
let mut buffered = BufReader::new(f);
Expand Down
80 changes: 44 additions & 36 deletions src/internal/pack/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ impl Pack {
#[cfg(test)]
mod tests {
use std::{
fs,
env, fs,
io::{BufReader, Cursor, prelude::*},
path::PathBuf,
sync::{
Expand All @@ -810,12 +810,13 @@ mod tests {

use crate::{
hash::{HashKind, ObjectHash, set_hash_kind_for_test},
internal::pack::{Pack, test_pack_download::download_pack_file, tests::init_logger},
internal::pack::{Pack, tests::init_logger},
};

#[tokio::test]
async fn test_pack_check_header() {
let (source, _guard) = download_pack_file("medium-sha1.pack");
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push("tests/data/packs/medium-sha1.pack");

let f = fs::File::open(source).unwrap();
let mut buf_reader = BufReader::new(f);
Expand Down Expand Up @@ -862,9 +863,10 @@ mod tests {
}

/// Helper function to run decode tests without delta objects
fn run_decode_no_delta(filename: &str, kind: HashKind) {
fn run_decode_no_delta(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");

Expand All @@ -876,16 +878,17 @@ mod tests {
}
#[test]
fn test_pack_decode_without_delta() {
run_decode_no_delta("small-sha1.pack", HashKind::Sha1);
run_decode_no_delta("small-sha256.pack", HashKind::Sha256);
run_decode_no_delta("tests/data/packs/small-sha1.pack", HashKind::Sha1);
run_decode_no_delta("tests/data/packs/small-sha256.pack", HashKind::Sha256);
}

/// Helper function to run decode tests with delta objects
fn run_decode_with_ref_delta(filename: &str, kind: HashKind) {
fn run_decode_with_ref_delta(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
init_logger();

let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");

Expand All @@ -897,14 +900,15 @@ mod tests {
}
#[test]
fn test_pack_decode_with_ref_delta() {
run_decode_with_ref_delta("ref-delta-sha1.pack", HashKind::Sha1);
run_decode_with_ref_delta("ref-delta-sha256.pack", HashKind::Sha256);
run_decode_with_ref_delta("tests/data/packs/ref-delta-sha1.pack", HashKind::Sha1);
run_decode_with_ref_delta("tests/data/packs/ref-delta-sha256.pack", HashKind::Sha256);
}

/// Helper function to run decode tests without memory limit
fn run_decode_no_mem_limit(filename: &str, kind: HashKind) {
fn run_decode_no_mem_limit(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");

Expand All @@ -916,15 +920,16 @@ mod tests {
}
#[test]
fn test_pack_decode_no_mem_limit() {
run_decode_no_mem_limit("small-sha1.pack", HashKind::Sha1);
run_decode_no_mem_limit("small-sha256.pack", HashKind::Sha256);
run_decode_no_mem_limit("tests/data/packs/small-sha1.pack", HashKind::Sha1);
run_decode_no_mem_limit("tests/data/packs/small-sha256.pack", HashKind::Sha256);
}

/// Helper function to run decode tests with delta objects
async fn run_decode_large_with_delta(filename: &str, kind: HashKind) {
async fn run_decode_large_with_delta(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
init_logger();
let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");

Expand All @@ -950,15 +955,16 @@ mod tests {
}
#[tokio::test]
async fn test_pack_decode_with_large_file_with_delta_without_ref() {
run_decode_large_with_delta("medium-sha1.pack", HashKind::Sha1).await;
run_decode_large_with_delta("medium-sha256.pack", HashKind::Sha256).await;
run_decode_large_with_delta("tests/data/packs/medium-sha1.pack", HashKind::Sha1).await;
run_decode_large_with_delta("tests/data/packs/medium-sha256.pack", HashKind::Sha256).await;
} // it will be stuck on dropping `Pack` on Windows if `mem_size` is None, so we need `mimalloc`

/// Helper function to run decode tests with large file stream
async fn run_decode_large_stream(filename: &str, kind: HashKind) {
async fn run_decode_large_stream(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
init_logger();
let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");
let f = tokio::fs::File::open(source).await.unwrap();
Expand All @@ -985,14 +991,15 @@ mod tests {
}
#[tokio::test]
async fn test_decode_large_file_stream() {
run_decode_large_stream("medium-sha1.pack", HashKind::Sha1).await;
run_decode_large_stream("medium-sha256.pack", HashKind::Sha256).await;
run_decode_large_stream("tests/data/packs/medium-sha1.pack", HashKind::Sha1).await;
run_decode_large_stream("tests/data/packs/medium-sha256.pack", HashKind::Sha256).await;
}

/// Helper function to run decode tests with large file async
async fn run_decode_large_file_async(filename: &str, kind: HashKind) {
async fn run_decode_large_file_async(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");
let f = fs::File::open(source).unwrap();
Expand All @@ -1010,14 +1017,15 @@ mod tests {
}
#[tokio::test]
async fn test_decode_large_file_async() {
run_decode_large_file_async("medium-sha1.pack", HashKind::Sha1).await;
run_decode_large_file_async("medium-sha256.pack", HashKind::Sha256).await;
run_decode_large_file_async("tests/data/packs/medium-sha1.pack", HashKind::Sha1).await;
run_decode_large_file_async("tests/data/packs/medium-sha256.pack", HashKind::Sha256).await;
}

/// Helper function to run decode tests with delta objects without reference
fn run_decode_with_delta_no_ref(filename: &str, kind: HashKind) {
fn run_decode_with_delta_no_ref(rel_path: &str, kind: HashKind) {
let _guard = set_hash_kind_for_test(kind);
let (source, _dl_guard) = download_pack_file(filename);
let mut source = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
source.push(rel_path);

let tmp = PathBuf::from("/tmp/.cache_temp");

Expand All @@ -1029,8 +1037,8 @@ mod tests {
}
#[test]
fn test_pack_decode_with_delta_without_ref() {
run_decode_with_delta_no_ref("medium-sha1.pack", HashKind::Sha1);
run_decode_with_delta_no_ref("medium-sha256.pack", HashKind::Sha256);
run_decode_with_delta_no_ref("tests/data/packs/medium-sha1.pack", HashKind::Sha1);
run_decode_with_delta_no_ref("tests/data/packs/medium-sha256.pack", HashKind::Sha256);
}

#[test] // Take too long time
Expand All @@ -1041,12 +1049,12 @@ mod tests {
.unwrap();
rt.block_on(async move {
// For each hash kind, run two decode tasks concurrently to simulate multi-task pressure.
for (kind, filename) in [
(HashKind::Sha1, "medium-sha1.pack"),
(HashKind::Sha256, "medium-sha256.pack"),
for (kind, path) in [
(HashKind::Sha1, "tests/data/packs/medium-sha1.pack"),
(HashKind::Sha256, "tests/data/packs/medium-sha256.pack"),
] {
let f1 = run_decode_large_with_delta(filename, kind);
let f2 = run_decode_large_with_delta(filename, kind);
let f1 = run_decode_large_with_delta(path, kind);
let f2 = run_decode_large_with_delta(path, kind);
let _ = futures::future::join(f1, f2).await;
}
});
Expand Down
Loading
Loading