mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 11:45:06 +03:00
move ReferenceName tagged string to gitbutler-reference crate
gitbutler-reference is where ReferenceName belongs. There are other thing in this crate that are not nice, but let's clean those up!
This commit is contained in:
parent
d010d56044
commit
87f956d871
5
Cargo.lock
generated
5
Cargo.lock
generated
@ -1972,7 +1972,6 @@ dependencies = [
|
||||
"gitbutler-id",
|
||||
"gitbutler-reference",
|
||||
"gitbutler-serde",
|
||||
"gitbutler-tagged-string",
|
||||
"hex",
|
||||
"itertools 0.13.0",
|
||||
"lazy_static",
|
||||
@ -2003,7 +2002,6 @@ dependencies = [
|
||||
"gitbutler-reference",
|
||||
"gitbutler-repo",
|
||||
"gitbutler-serde",
|
||||
"gitbutler-tagged-string",
|
||||
"gitbutler-testsupport",
|
||||
"gitbutler-time",
|
||||
"gitbutler-url",
|
||||
@ -2149,9 +2147,9 @@ dependencies = [
|
||||
"gitbutler-branch",
|
||||
"gitbutler-fs",
|
||||
"gitbutler-project",
|
||||
"gitbutler-reference",
|
||||
"gitbutler-repo",
|
||||
"gitbutler-serde",
|
||||
"gitbutler-tagged-string",
|
||||
"gix",
|
||||
"itertools 0.13.0",
|
||||
"pretty_assertions",
|
||||
@ -2303,7 +2301,6 @@ dependencies = [
|
||||
"gitbutler-repo",
|
||||
"gitbutler-secret",
|
||||
"gitbutler-storage",
|
||||
"gitbutler-tagged-string",
|
||||
"gitbutler-testsupport",
|
||||
"gitbutler-user",
|
||||
"gitbutler-watcher",
|
||||
|
@ -21,7 +21,6 @@ gitbutler-id.workspace = true
|
||||
gitbutler-time.workspace = true
|
||||
gitbutler-commit.workspace = true
|
||||
gitbutler-url.workspace = true
|
||||
gitbutler-tagged-string.workspace = true
|
||||
serde = { workspace = true, features = ["std"] }
|
||||
bstr = "1.9.1"
|
||||
diffy = "0.3.0"
|
||||
|
@ -12,9 +12,9 @@ use gitbutler_oplog::{
|
||||
snapshot::Snapshot,
|
||||
};
|
||||
use gitbutler_project::{FetchResult, Project};
|
||||
use gitbutler_reference::ReferenceName;
|
||||
use gitbutler_reference::{Refname, RemoteRefname};
|
||||
use gitbutler_repo::{credentials::Helper, RepoActions, RepositoryExt};
|
||||
use gitbutler_tagged_string::ReferenceName;
|
||||
use std::path::Path;
|
||||
|
||||
use crate::{
|
||||
|
@ -9,9 +9,9 @@ use gitbutler_branch::target::Target;
|
||||
use gitbutler_branch::VirtualBranchesHandle;
|
||||
use gitbutler_command_context::ProjectRepository;
|
||||
use gitbutler_project::FetchResult;
|
||||
use gitbutler_reference::ReferenceName;
|
||||
use gitbutler_reference::{Refname, RemoteRefname};
|
||||
use gitbutler_repo::{LogUntil, RepoActions, RepositoryExt};
|
||||
use gitbutler_tagged_string::ReferenceName;
|
||||
use serde::Serialize;
|
||||
|
||||
use super::r#virtual as vb;
|
||||
|
@ -18,9 +18,9 @@ use gitbutler_command_context::ProjectRepository;
|
||||
use gitbutler_commit::commit_headers::{CommitHeadersV2, HasCommitHeaders};
|
||||
use gitbutler_error::error::Marker;
|
||||
use gitbutler_oplog::snapshot::Snapshot;
|
||||
use gitbutler_reference::ReferenceName;
|
||||
use gitbutler_reference::{normalize_branch_name, Refname};
|
||||
use gitbutler_repo::{rebase::cherry_rebase, RepoActions, RepositoryExt};
|
||||
use gitbutler_tagged_string::ReferenceName;
|
||||
use gitbutler_time::time::now_since_unix_epoch_ms;
|
||||
|
||||
pub struct BranchManager<'l> {
|
||||
|
@ -9,7 +9,6 @@ publish = false
|
||||
anyhow = "1.0.86"
|
||||
git2.workspace = true
|
||||
gitbutler-reference.workspace = true
|
||||
gitbutler-tagged-string.workspace = true
|
||||
gitbutler-serde.workspace = true
|
||||
gitbutler-id.workspace = true
|
||||
gitbutler-error.workspace = true
|
||||
|
@ -1,5 +1,5 @@
|
||||
use anyhow::{Context, Result};
|
||||
use gitbutler_tagged_string::ReferenceName;
|
||||
use gitbutler_reference::ReferenceName;
|
||||
|
||||
pub trait BranchExt {
|
||||
fn reference_name(&self) -> Result<ReferenceName>;
|
||||
|
@ -19,7 +19,7 @@ gitbutler-project.workspace = true
|
||||
gitbutler-branch.workspace = true
|
||||
gitbutler-serde.workspace = true
|
||||
gitbutler-fs.workspace = true
|
||||
gitbutler-tagged-string.workspace = true
|
||||
gitbutler-reference.workspace = true
|
||||
|
||||
[[test]]
|
||||
name = "oplog"
|
||||
|
@ -1,7 +1,7 @@
|
||||
use anyhow::Result;
|
||||
use gitbutler_branch::branch::{Branch, BranchUpdateRequest};
|
||||
use gitbutler_project::Project;
|
||||
use gitbutler_tagged_string::ReferenceName;
|
||||
use gitbutler_reference::ReferenceName;
|
||||
use std::vec;
|
||||
|
||||
use crate::{
|
||||
|
@ -1,4 +1,5 @@
|
||||
mod refname;
|
||||
use gitbutler_tagged_string::TaggedString;
|
||||
pub use refname::{LocalRefname, Refname, RemoteRefname, VirtualRefname};
|
||||
use regex::Regex;
|
||||
|
||||
@ -6,3 +7,7 @@ pub fn normalize_branch_name(name: &str) -> String {
|
||||
let pattern = Regex::new("[^A-Za-z0-9_/.#]+").unwrap();
|
||||
pattern.replace_all(name, "-").to_string()
|
||||
}
|
||||
|
||||
pub struct _ReferenceName;
|
||||
/// The name of a reference ie. `refs/heads/master`
|
||||
pub type ReferenceName = TaggedString<_ReferenceName>;
|
||||
|
@ -54,7 +54,3 @@ impl<T> fmt::Debug for TaggedString<T> {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct _ReferenceName;
|
||||
/// The name of a reference ie. `refs/heads/master`
|
||||
pub type ReferenceName = TaggedString<_ReferenceName>;
|
||||
|
@ -60,7 +60,6 @@ gitbutler-error.workspace = true
|
||||
gitbutler-secret.workspace = true
|
||||
gitbutler-id.workspace = true
|
||||
gitbutler-storage.workspace = true
|
||||
gitbutler-tagged-string.workspace = true
|
||||
open = "5"
|
||||
|
||||
[dependencies.tauri]
|
||||
|
@ -10,8 +10,8 @@ pub mod commands {
|
||||
use gitbutler_error::error::Code;
|
||||
use gitbutler_project as projects;
|
||||
use gitbutler_project::ProjectId;
|
||||
use gitbutler_reference::ReferenceName;
|
||||
use gitbutler_reference::{Refname, RemoteRefname};
|
||||
use gitbutler_tagged_string::ReferenceName;
|
||||
use tauri::{AppHandle, Manager};
|
||||
use tracing::instrument;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user