Skip to content

Commit db197b0

Browse files
committed
Use ctx to access specific paths, don't hardcode it.
With genAI there is the permanent fear this might be repeated, so let's fix it.
1 parent 35043dd commit db197b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/gitbutler-oplog/src/oplog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ pub fn prepare_snapshot(
448448
// It may be the case that with the refactoring through `but-meta` the head value is no longer in sync so sync_heads_with_references is the final attempt to sync it
449449
// This is relevant only for snapshot restore.
450450
// Create a blob out of `.git/gitbutler/virtual_branches.toml`
451-
let vb_path = repo.path().join("gitbutler").join("virtual_branches.toml");
451+
let vb_path = ctx.project_data_dir().join("virtual_branches.toml");
452452
let vb_content = fs::read(vb_path)?;
453453
let vb_blob_id = repo.blob(&vb_content)?;
454454
tree_builder.insert("virtual_branches.toml", vb_blob_id, FileMode::Blob.into())?;

0 commit comments

Comments
 (0)