Skip to content

Commit

Permalink
Use the latest gix release for API improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 22, 2023
1 parent 084f226 commit f50308f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name = "sparse_http_ureq"
required-features = ["sparse-http"]

[dependencies]
gix = { version = "0.49.0", default-features = false, features = ["max-performance-safe", "blocking-network-client"], optional = true }
gix = { version = "0.50.0", default-features = false, features = ["max-performance-safe", "blocking-network-client"], optional = true }
hex = { version = "0.4.3", features = ["serde"] }
home = "0.5.4"
http = { version = "0.2", optional = true }
Expand Down
10 changes: 4 additions & 6 deletions src/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,12 @@ impl<'repo> ChangesIter<'repo> {
}
if new_entry.mode().is_tree() {
let new_tree = new_entry.object()?.into_tree();
let name_bytes = new_entry.filename();
let name = new_entry.filename();
// Recurse only into crate subdirs, and they all happen to be 1 or 2 letters long
let is_crates_subdir = name_bytes.len() <= 2 && name_bytes.iter().copied().all(valid_crate_name_char);
let is_crates_subdir = name.len() <= 2 && name.iter().copied().all(valid_crate_name_char);
let old_obj = if is_crates_subdir {
old.entries
.binary_search_by(|entry| entry.filename.cmp(name_bytes))
.ok()
.map(|idx| old.entries[idx].attach(repo))
old.bisect_entry(name, true)
.map(|entry| entry.attach(repo))
} else {
None
}
Expand Down

0 comments on commit f50308f

Please sign in to comment.