Skip to content

Commit 9acab66

Browse files
committed
Fix broken test
- make use of integration commit title constant
1 parent f3e5228 commit 9acab66

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

crates/gitbutler-branch-actions/src/integration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::{branch_manager::BranchManagerExt, conflicts, VirtualBranchesExt};
1919

2020
const WORKSPACE_HEAD: &str = "Workspace Head";
2121
const GITBUTLER_INTEGRATION_COMMIT_TITLE: &str = "GitButler Integration Commit";
22-
const GITBUTLER_WORKSPACE_COMMIT_TITLE: &str = "GitButler Workspace Commit";
22+
pub const GITBUTLER_WORKSPACE_COMMIT_TITLE: &str = "GitButler Workspace Commit";
2323

2424
/// Creates and returns a merge commit of all active branch heads.
2525
///

crates/gitbutler-branch-actions/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,5 @@ pub use branch::{
4444
get_branch_listing_details, list_branches, Author, BranchListing, BranchListingDetails,
4545
BranchListingFilter,
4646
};
47+
48+
pub use integration::GITBUTLER_WORKSPACE_COMMIT_TITLE;

crates/gitbutler-branch-actions/tests/virtual_branches/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::{fs, path, path::PathBuf, str::FromStr};
22

33
use gitbutler_branch::{BranchCreateRequest, VirtualBranchesHandle};
4+
use gitbutler_branch_actions::GITBUTLER_WORKSPACE_COMMIT_TITLE;
45
use gitbutler_branch_actions::{update_gitbutler_integration, VirtualBranchActions};
56
use gitbutler_command_context::CommandContext;
67
use gitbutler_error::error::Marker;

crates/gitbutler-branch-actions/tests/virtual_branches/oplog.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ fn restores_gitbutler_integration() -> anyhow::Result<()> {
265265
let commit = &head.peel_to_commit()?;
266266
let commit1_id = commit.id();
267267
let message = commit.summary().unwrap();
268-
assert_eq!(message, "GitButler Integration Commit");
268+
assert_eq!(message, GITBUTLER_WORKSPACE_COMMIT_TITLE);
269269

270270
// create second commit
271271
fs::write(repository.path().join("file.txt"), "changed content")?;
@@ -276,7 +276,7 @@ fn restores_gitbutler_integration() -> anyhow::Result<()> {
276276
let commit = &head.peel_to_commit()?;
277277
let commit2_id = commit.id();
278278
let message = commit.summary().unwrap();
279-
assert_eq!(message, "GitButler Integration Commit");
279+
assert_eq!(message, GITBUTLER_WORKSPACE_COMMIT_TITLE);
280280
assert_ne!(commit1_id, commit2_id);
281281

282282
// restore the first

crates/gitbutler-operating-modes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub mod commands;
1111
pub const WORKSPACE_BRANCH_REF: &str = "refs/heads/gitbutler/workspace";
1212

1313
/// Previous workspace reference, delete after transition.
14-
pub const INTEGRATION_BRANCH_REF: &str = "refs/heads/gitbutler/integration";
14+
const INTEGRATION_BRANCH_REF: &str = "refs/heads/gitbutler/integration";
1515

1616
/// To prevent clients hitting the "looks like you've moved away from..."
1717
/// after upgrading to a version using the new gitbutler/workspace branch

crates/gitbutler-reference/tests/reference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ mod normalize_branch_name {
4848
assert_eq!(normalize_branch_name("#[test]")?, "#-test]");
4949
assert_eq!(normalize_branch_name("foo#branch")?, "foo#branch");
5050
assert_eq!(normalize_branch_name("foo!branch")?, "foo!branch");
51-
let input = r#"Revert "GitButler Integration Commit"
51+
let input = r#"Revert "GitButler Workspace Commit"
5252
5353
This reverts commit d6efa5fd96d36da445d5d1345b84163f05f5f229."#;
54-
assert_eq!(normalize_branch_name(input)?, "Revert-\"GitButler-Integration-Commit\"-This-reverts-commit-d6efa5fd96d36da445d5d1345b84163f05f5f229");
54+
assert_eq!(normalize_branch_name(input)?, "Revert-\"GitButler-Workspace-Commit\"-This-reverts-commit-d6efa5fd96d36da445d5d1345b84163f05f5f229");
5555
Ok(())
5656
}
5757
}

0 commit comments

Comments
 (0)