move remaining integration constants to core

This commit is contained in:
Kiril Videlov 2024-07-07 16:49:25 +02:00
parent 0865521f90
commit f224207029
No known key found for this signature in database
GPG Key ID: A4C733025427C471
4 changed files with 15 additions and 11 deletions

View File

@ -10,10 +10,9 @@ use anyhow::Result;
use tracing::instrument;
use crate::git::diff::FileDiff;
use crate::virtual_branches::integration::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
use crate::virtual_branches::{
Branch, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
};
use crate::virtual_branches::Branch;
use crate::{git::diff::hunks_by_filepath, git::RepositoryExt, projects::Project};
use super::{

View File

@ -1,12 +1,13 @@
use crate::fs::write;
use crate::{
fs::write,
virtual_branches::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
},
};
use anyhow::{Context, Result};
use gix::config::tree::Key;
use std::path::Path;
use crate::virtual_branches::integration::{
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME,
};
/// Sets a reference to the oplog head commit such that snapshots are reachable and will not be garbage collected.
/// We want to achieve 2 things:
/// - The oplog must not be visible in `git log --all` as branch

View File

@ -3,7 +3,10 @@ use std::{path::PathBuf, vec};
use anyhow::{anyhow, bail, Context, Result};
use bstr::ByteSlice;
use super::{VirtualBranchesHandle, GITBUTLER_INTEGRATION_REFERENCE};
use super::{
VirtualBranchesHandle, GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL,
GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME, GITBUTLER_INTEGRATION_REFERENCE,
};
use crate::error::Marker;
use crate::git::RepositoryExt;
use crate::{
@ -13,8 +16,6 @@ use crate::{
};
const WORKSPACE_HEAD: &str = "Workspace Head";
pub const GITBUTLER_INTEGRATION_COMMIT_AUTHOR_NAME: &str = "GitButler";
pub const GITBUTLER_INTEGRATION_COMMIT_AUTHOR_EMAIL: &str = "gitbutler@gitbutler.com";
pub fn get_integration_commiter<'a>() -> Result<git2::Signature<'a>> {
Ok(git2::Signature::now(

View File

@ -25,3 +25,6 @@ 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";