Skip to content

Commit 7ec5240

Browse files
authored
upgrade git-repository 0.30 to gix 0.36 (#963)
This upgrade is mainly to benefit from the new names of all `git-*` crates which now share the `gix-` prefix, with `gix` naturally being what was formerly `git-repository`. Now there is no need anymore to rename crates in order to get the `git` namespace, instead we refer to `gitoxide` as `gix` from the get-go.
1 parent a4f9109 commit 7ec5240

File tree

16 files changed

+601
-302
lines changed

16 files changed

+601
-302
lines changed

Cargo.lock

Lines changed: 571 additions & 272 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ clap_complete = "4.1.0"
2626
git-features-for-configuration-only = { package = "git-features", version = "0.23.1", features = [
2727
"zlib-ng-compat",
2828
] }
29-
git-repository = { version = "0.30.2", default-features = false, features = [
29+
gix = { version = "0.36.0", default-features = false, features = [
3030
"max-performance-safe",
3131
] }
3232
git2 = { version = "0.16.1", default-features = false }

benches/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use criterion::{black_box, criterion_group, criterion_main, Criterion};
2-
use git_repository::{open, ThreadSafeRepository};
2+
use gix::{open, ThreadSafeRepository};
33
use onefetch::{cli::Config, info::Info};
44

55
fn bench_repo_info(c: &mut Criterion) {

src/info/author.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use crate::{
66
utils::info_field::{InfoField, InfoType},
77
},
88
};
9-
use git_repository as git;
109
use owo_colors::{DynColors, OwoColorize};
1110
use serde::Serialize;
1211
use std::fmt::Write;
@@ -26,8 +25,8 @@ pub struct Author {
2625

2726
impl Author {
2827
pub fn new(
29-
name: git::bstr::BString,
30-
email: git::bstr::BString,
28+
name: gix::bstr::BString,
29+
email: gix::bstr::BString,
3130
nbr_of_commits: usize,
3231
total_nbr_of_commits: usize,
3332
show_email: bool,

src/info/contributors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mod test {
5959
#[test]
6060
fn test_display_contributors_info() {
6161
use crate::info::utils::git::Commits;
62-
use git_repository::actor::Time;
62+
use gix::actor::Time;
6363

6464
let timestamp = Time::now_utc();
6565
let commits = Commits {

src/info/head.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::info::utils::info_field::{InfoField, InfoType};
22
use anyhow::{Context, Result};
3-
use git_repository::{reference::Category, Reference, Repository};
3+
use gix::{reference::Category, Reference, Repository};
44
use serde::Serialize;
55

66
#[derive(Serialize)]

src/info/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl std::fmt::Display for Info {
111111

112112
impl Info {
113113
pub fn new(config: &Config) -> Result<Self> {
114-
let git_repo = git_repository::discover(&config.input)?;
114+
let git_repo = gix::discover(&config.input)?;
115115
let repo_path = get_work_dir(&git_repo)?;
116116

117117
let loc_by_language_sorted_handle = std::thread::spawn({
@@ -267,7 +267,7 @@ fn get_manifest(repo_path: &Path) -> Result<Option<Manifest>> {
267267
}
268268
}
269269

270-
pub fn get_work_dir(repo: &git_repository::Repository) -> Result<std::path::PathBuf> {
270+
pub fn get_work_dir(repo: &gix::Repository) -> Result<std::path::PathBuf> {
271271
Ok(repo
272272
.work_dir()
273273
.context("please run onefetch inside of a non-bare git repository")?

src/info/pending.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::info::utils::info_field::{InfoField, InfoType};
22
use anyhow::Result;
33
use git2::{Status, StatusOptions, StatusShow};
4-
use git_repository::Repository;
4+
use gix::Repository;
55
use serde::Serialize;
66

77
#[derive(Serialize)]

src/info/project.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
},
77
};
88
use anyhow::Result;
9-
use git_repository::{bstr::ByteSlice, Repository};
9+
use gix::{bstr::ByteSlice, Repository};
1010
use onefetch_manifest::Manifest;
1111
use serde::Serialize;
1212
use std::ffi::OsStr;
@@ -44,8 +44,8 @@ fn get_repo_name(repo_url: &str, manifest: Option<&Manifest>) -> Result<String>
4444
if repo_url.is_empty() {
4545
return Ok(String::default());
4646
}
47-
let url = git_repository::url::parse(repo_url.into())?;
48-
let path = git_repository::path::from_bstr(url.path.as_bstr());
47+
let url = gix::url::parse(repo_url.into())?;
48+
let path = gix::path::from_bstr(url.path.as_bstr());
4949
let repo_name = path
5050
.with_extension("")
5151
.file_name()

src/info/size.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{
66
},
77
};
88
use byte_unit::Byte;
9-
use git_repository::Repository;
9+
use gix::Repository;
1010
use serde::Serialize;
1111

1212
#[derive(Serialize)]

0 commit comments

Comments
 (0)