move virtual branch constatns out of the core create

This commit is contained in:
Kiril Videlov 2024-07-09 00:45:10 +02:00
parent 17b8214c5d
commit 0b1ecf7b54
No known key found for this signature in database
GPG Key ID: A4C733025427C471
9 changed files with 20 additions and 20 deletions

1
Cargo.lock generated
View File

@ -2112,6 +2112,7 @@ dependencies = [
"gitbutler-core",
"hex",
"itertools 0.13.0",
"lazy_static",
"md5",
"serde",
"tracing",

View File

@ -15,6 +15,7 @@ bstr = "1.9.1"
md5 = "0.7.0"
hex = "0.4.3"
tracing = "0.1.40"
lazy_static = "1.4.0"
[[test]]
name="branch"

View File

@ -5,3 +5,12 @@ pub mod hunk;
pub mod ownership;
pub mod serde;
pub mod target;
use lazy_static::lazy_static;
lazy_static! {
pub static ref GITBUTLER_INTEGRATION_REFERENCE: gitbutler_core::git::LocalRefname =
gitbutler_core::git::LocalRefname::new("gitbutler/integration", None);
}
pub const GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME: &str = "GitButler";
pub const GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL: &str = "gitbutler@gitbutler.com";

View File

@ -26,6 +26,5 @@ pub mod ssh;
pub mod storage;
pub mod time;
pub mod types;
pub mod virtual_branches;
#[cfg(target_os = "windows")]
pub mod windows;

View File

@ -1,8 +0,0 @@
use lazy_static::lazy_static;
lazy_static! {
pub static ref GITBUTLER_INTEGRATION_REFERENCE: crate::git::LocalRefname =
crate::git::LocalRefname::new("gitbutler/integration", None);
}
pub const GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME: &str = "GitButler";
pub const GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL: &str = "gitbutler@gitbutler.com";

View File

@ -14,7 +14,7 @@ use std::{fs, path::PathBuf};
use anyhow::Result;
use tracing::instrument;
use gitbutler_core::virtual_branches::{
use gitbutler_branch::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
};

View File

@ -1,10 +1,8 @@
use anyhow::{Context, Result};
use gitbutler_core::{
fs::write,
virtual_branches::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
},
use gitbutler_branch::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
};
use gitbutler_core::fs::write;
use gix::config::tree::Key;
use std::path::Path;

View File

@ -18,9 +18,9 @@ use crate::conflicts::RepoConflicts;
use crate::integration::{get_workspace_head, update_gitbutler_integration};
use crate::remote::{commit_to_remote_commit, RemoteCommit};
use crate::VirtualBranchHunk;
use gitbutler_branch::GITBUTLER_INTEGRATION_REFERENCE;
use gitbutler_core::error::Marker;
use gitbutler_core::git;
use gitbutler_core::virtual_branches::GITBUTLER_INTEGRATION_REFERENCE;
use gitbutler_repo::rebase::cherry_rebase;
#[derive(Debug, Serialize, PartialEq, Clone)]

View File

@ -4,14 +4,14 @@ use anyhow::{anyhow, bail, Context, Result};
use bstr::ByteSlice;
use gitbutler_branch::branch::BranchCreateRequest;
use gitbutler_branch::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
GITBUTLER_INTEGRATION_REFERENCE,
};
use gitbutler_branchstate::{VirtualBranchesAccess, VirtualBranchesHandle};
use gitbutler_command_context::ProjectRepo;
use gitbutler_core::error::Marker;
use gitbutler_core::git::CommitExt;
use gitbutler_core::virtual_branches::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
GITBUTLER_INTEGRATION_REFERENCE,
};
use gitbutler_repo::{LogUntil, RepoActions, RepositoryExt};
use crate::conflicts;