Skip to content

Commit aba18bb

Browse files
authored
Merge pull request #11430 from Byron/fix
Update to `gix@main` to see URL related fixes (#11419)
2 parents 7d4af69 + de6f453 commit aba18bb

File tree

16 files changed

+454
-396
lines changed

16 files changed

+454
-396
lines changed

Cargo.lock

Lines changed: 413 additions & 368 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
@@ -65,7 +65,7 @@ gitbutler-workspace = { path = "crates/gitbutler-workspace" }
6565

6666
bstr = "1.12.1"
6767
# Add the `tracing` or `tracing-detail` features to see more of gitoxide in the logs. Useful to see which programs it invokes.
68-
gix = { version = "0.75.0", default-features = false, features = [] }
68+
gix = { version = "0.75.0", git = "https://github.com/GitoxideLabs/gitoxide", branch = "main", default-features = false, features = [] }
6969
ts-rs = { version = "11.1.0", features = ["serde-compat", "no-serde-warnings"] }
7070
gix-testtools = "0.16.1"
7171
insta = "1.44.3"

crates/but-core/src/commit.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ impl TreeKind {
191191
impl<'repo> Commit<'repo> {
192192
/// Decode the object at `commit_id` and keep its data for later query.
193193
pub fn from_id(commit_id: gix::Id<'repo>) -> anyhow::Result<Self> {
194-
let commit = commit_id.object()?.try_into_commit()?.decode()?.into();
194+
let commit = commit_id
195+
.object()?
196+
.try_into_commit()?
197+
.decode()?
198+
.try_into()?;
195199
Ok(Commit {
196200
id: commit_id,
197201
inner: commit,

crates/but-core/tests/core/worktree/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mod utils {
1818
tree: editor.write()?.detach(),
1919
parents: [head_commit.id].into(),
2020
message: message.into(),
21-
..head_commit.decode()?.to_owned()
21+
..head_commit.decode()?.to_owned()?
2222
})?
2323
.detach();
2424
Ok((head_commit, repo.find_commit(new_commit_id)?))

crates/but-rebase/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ fn rebase(
315315
)?;
316316

317317
// Now, lets pretend the base didn't exist by swapping parent with the parent of the base
318-
let mut new_commit = repo.find_commit(new_commit)?.decode()?.to_owned();
318+
let mut new_commit = repo.find_commit(new_commit)?.decode()?.to_owned()?;
319319
new_commit.parents = base_commit.parent_ids().map(|id| id.detach()).collect();
320320
if let Some(new_message) = new_message {
321321
new_commit.message = new_message;
@@ -350,15 +350,15 @@ fn to_commit(repo: &gix::Repository, commit_id: gix::ObjectId) -> Result<gix::ob
350350
.object()?
351351
.into_commit()
352352
.decode()?
353-
.into())
353+
.try_into()?)
354354
}
355355

356356
fn reword_commit(
357357
repo: &gix::Repository,
358358
oid: gix::ObjectId,
359359
new_message: BString,
360360
) -> Result<gix::ObjectId> {
361-
let mut new_commit = repo.find_commit(oid)?.decode()?.to_owned();
361+
let mut new_commit = repo.find_commit(oid)?.decode()?.to_owned()?;
362362
new_commit.message = new_message;
363363
Ok(commit::create(
364364
repo,
@@ -373,7 +373,7 @@ pub fn replace_commit_tree(
373373
oid: gix::ObjectId,
374374
new_tree: gix::ObjectId,
375375
) -> Result<gix::ObjectId> {
376-
let mut new_commit = repo.find_commit(oid)?.decode()?.to_owned();
376+
let mut new_commit = repo.find_commit(oid)?.decode()?.to_owned()?;
377377
new_commit.tree = new_tree;
378378
Ok(commit::create(
379379
repo,

crates/but-workspace/src/branch_details.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@ fn upstream_commits_gix(
190190
let id = id?.to_gix().attach(upstream_id.repo);
191191
let commit = id.object()?.into_commit();
192192
let commit = commit.decode()?;
193-
let author: ui::Author = commit.author().into();
194-
let commiter: ui::Author = commit.committer().into();
193+
let author: ui::Author = commit.author()?.into();
194+
let commiter: ui::Author = commit.committer()?.into();
195195
authors.insert(author.clone());
196196
authors.insert(commiter);
197197
out.push(UpstreamCommit {
198198
id: id.detach(),
199199
message: commit.message.into(),
200-
created_at: i128::from(commit.time().seconds) * 1000,
200+
created_at: i128::from(commit.time()?.seconds) * 1000,
201201
author,
202202
});
203203
}

crates/but-workspace/src/commit.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,11 @@ impl<'repo> WorkspaceCommit<'repo> {
436436

437437
/// Decode the object at `commit_id` and keep its data for later query.
438438
pub fn from_id(commit_id: gix::Id<'repo>) -> anyhow::Result<Self> {
439-
let commit = commit_id.object()?.try_into_commit()?.decode()?.into();
439+
let commit = commit_id
440+
.object()?
441+
.try_into_commit()?
442+
.decode()?
443+
.try_into()?;
440444
Ok(WorkspaceCommit {
441445
id: commit_id,
442446
inner: commit,

crates/but-workspace/src/legacy/commit_engine/reference_frame.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl ReferenceFrame {
2020
mode: InferenceMode,
2121
) -> anyhow::Result<Self> {
2222
let head_id = repo.head_id()?;
23-
let workspace_commit = head_id.object()?.into_commit().decode()?.to_owned();
23+
let workspace_commit = head_id.object()?.into_commit().decode()?.to_owned()?;
2424

2525
let cache = repo.commit_graph_if_enabled()?;
2626
let mut graph = repo.revision_graph(cache.as_ref());

crates/but-workspace/tests/workspace/commit_engine/amend_commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn signatures_are_redone() -> anyhow::Result<()> {
216216
let (mut repo, _tmp) = writable_scenario_with_ssh_key("two-signed-commits-with-line-offset");
217217

218218
let head_id = repo.head_id()?;
219-
let head_commit = head_id.object()?.into_commit().decode()?.to_owned();
219+
let head_commit = head_id.object()?.into_commit().decode()?.to_owned()?;
220220
let head_id = head_id.detach();
221221
let previous_signature = head_commit
222222
.extra_headers()

crates/but-workspace/tests/workspace/commit_engine/new_commit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ fn signatures_are_redone() -> anyhow::Result<()> {
11821182
let (repo, _tmp) = writable_scenario_with_ssh_key("two-signed-commits-with-line-offset");
11831183

11841184
let head_id = repo.head_id()?;
1185-
let head_commit = head_id.object()?.into_commit().decode()?.to_owned();
1185+
let head_commit = head_id.object()?.into_commit().decode()?.to_owned()?;
11861186
let head_id = head_id.detach();
11871187
let previous_signature = head_commit
11881188
.extra_headers()

0 commit comments

Comments
 (0)