mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-22 09:01:45 +03:00
Merge pull request #4325 from gitbutlerapp/move-reference-name-to-gitbulter-reference-crate
move ReferenceName tagged string to gitbutler-reference crate
This commit is contained in:
commit
d0e2cf1274
5
Cargo.lock
generated
5
Cargo.lock
generated
@ -1972,7 +1972,6 @@ dependencies = [
|
|||||||
"gitbutler-id",
|
"gitbutler-id",
|
||||||
"gitbutler-reference",
|
"gitbutler-reference",
|
||||||
"gitbutler-serde",
|
"gitbutler-serde",
|
||||||
"gitbutler-tagged-string",
|
|
||||||
"hex",
|
"hex",
|
||||||
"itertools 0.13.0",
|
"itertools 0.13.0",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
@ -2003,7 +2002,6 @@ dependencies = [
|
|||||||
"gitbutler-reference",
|
"gitbutler-reference",
|
||||||
"gitbutler-repo",
|
"gitbutler-repo",
|
||||||
"gitbutler-serde",
|
"gitbutler-serde",
|
||||||
"gitbutler-tagged-string",
|
|
||||||
"gitbutler-testsupport",
|
"gitbutler-testsupport",
|
||||||
"gitbutler-time",
|
"gitbutler-time",
|
||||||
"gitbutler-url",
|
"gitbutler-url",
|
||||||
@ -2149,9 +2147,9 @@ dependencies = [
|
|||||||
"gitbutler-branch",
|
"gitbutler-branch",
|
||||||
"gitbutler-fs",
|
"gitbutler-fs",
|
||||||
"gitbutler-project",
|
"gitbutler-project",
|
||||||
|
"gitbutler-reference",
|
||||||
"gitbutler-repo",
|
"gitbutler-repo",
|
||||||
"gitbutler-serde",
|
"gitbutler-serde",
|
||||||
"gitbutler-tagged-string",
|
|
||||||
"gix",
|
"gix",
|
||||||
"itertools 0.13.0",
|
"itertools 0.13.0",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
@ -2303,7 +2301,6 @@ dependencies = [
|
|||||||
"gitbutler-repo",
|
"gitbutler-repo",
|
||||||
"gitbutler-secret",
|
"gitbutler-secret",
|
||||||
"gitbutler-storage",
|
"gitbutler-storage",
|
||||||
"gitbutler-tagged-string",
|
|
||||||
"gitbutler-testsupport",
|
"gitbutler-testsupport",
|
||||||
"gitbutler-user",
|
"gitbutler-user",
|
||||||
"gitbutler-watcher",
|
"gitbutler-watcher",
|
||||||
|
@ -21,7 +21,6 @@ gitbutler-id.workspace = true
|
|||||||
gitbutler-time.workspace = true
|
gitbutler-time.workspace = true
|
||||||
gitbutler-commit.workspace = true
|
gitbutler-commit.workspace = true
|
||||||
gitbutler-url.workspace = true
|
gitbutler-url.workspace = true
|
||||||
gitbutler-tagged-string.workspace = true
|
|
||||||
serde = { workspace = true, features = ["std"] }
|
serde = { workspace = true, features = ["std"] }
|
||||||
bstr = "1.9.1"
|
bstr = "1.9.1"
|
||||||
diffy = "0.3.0"
|
diffy = "0.3.0"
|
||||||
|
@ -12,9 +12,9 @@ use gitbutler_oplog::{
|
|||||||
snapshot::Snapshot,
|
snapshot::Snapshot,
|
||||||
};
|
};
|
||||||
use gitbutler_project::{FetchResult, Project};
|
use gitbutler_project::{FetchResult, Project};
|
||||||
|
use gitbutler_reference::ReferenceName;
|
||||||
use gitbutler_reference::{Refname, RemoteRefname};
|
use gitbutler_reference::{Refname, RemoteRefname};
|
||||||
use gitbutler_repo::{credentials::Helper, RepoActions, RepositoryExt};
|
use gitbutler_repo::{credentials::Helper, RepoActions, RepositoryExt};
|
||||||
use gitbutler_tagged_string::ReferenceName;
|
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -9,9 +9,9 @@ use gitbutler_branch::target::Target;
|
|||||||
use gitbutler_branch::VirtualBranchesHandle;
|
use gitbutler_branch::VirtualBranchesHandle;
|
||||||
use gitbutler_command_context::ProjectRepository;
|
use gitbutler_command_context::ProjectRepository;
|
||||||
use gitbutler_project::FetchResult;
|
use gitbutler_project::FetchResult;
|
||||||
|
use gitbutler_reference::ReferenceName;
|
||||||
use gitbutler_reference::{Refname, RemoteRefname};
|
use gitbutler_reference::{Refname, RemoteRefname};
|
||||||
use gitbutler_repo::{LogUntil, RepoActions, RepositoryExt};
|
use gitbutler_repo::{LogUntil, RepoActions, RepositoryExt};
|
||||||
use gitbutler_tagged_string::ReferenceName;
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::r#virtual as vb;
|
use super::r#virtual as vb;
|
||||||
|
@ -18,9 +18,9 @@ use gitbutler_command_context::ProjectRepository;
|
|||||||
use gitbutler_commit::commit_headers::{CommitHeadersV2, HasCommitHeaders};
|
use gitbutler_commit::commit_headers::{CommitHeadersV2, HasCommitHeaders};
|
||||||
use gitbutler_error::error::Marker;
|
use gitbutler_error::error::Marker;
|
||||||
use gitbutler_oplog::snapshot::Snapshot;
|
use gitbutler_oplog::snapshot::Snapshot;
|
||||||
|
use gitbutler_reference::ReferenceName;
|
||||||
use gitbutler_reference::{normalize_branch_name, Refname};
|
use gitbutler_reference::{normalize_branch_name, Refname};
|
||||||
use gitbutler_repo::{rebase::cherry_rebase, RepoActions, RepositoryExt};
|
use gitbutler_repo::{rebase::cherry_rebase, RepoActions, RepositoryExt};
|
||||||
use gitbutler_tagged_string::ReferenceName;
|
|
||||||
use gitbutler_time::time::now_since_unix_epoch_ms;
|
use gitbutler_time::time::now_since_unix_epoch_ms;
|
||||||
|
|
||||||
pub struct BranchManager<'l> {
|
pub struct BranchManager<'l> {
|
||||||
|
@ -9,7 +9,6 @@ publish = false
|
|||||||
anyhow = "1.0.86"
|
anyhow = "1.0.86"
|
||||||
git2.workspace = true
|
git2.workspace = true
|
||||||
gitbutler-reference.workspace = true
|
gitbutler-reference.workspace = true
|
||||||
gitbutler-tagged-string.workspace = true
|
|
||||||
gitbutler-serde.workspace = true
|
gitbutler-serde.workspace = true
|
||||||
gitbutler-id.workspace = true
|
gitbutler-id.workspace = true
|
||||||
gitbutler-error.workspace = true
|
gitbutler-error.workspace = true
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use gitbutler_tagged_string::ReferenceName;
|
use gitbutler_reference::ReferenceName;
|
||||||
|
|
||||||
pub trait BranchExt {
|
pub trait BranchExt {
|
||||||
fn reference_name(&self) -> Result<ReferenceName>;
|
fn reference_name(&self) -> Result<ReferenceName>;
|
||||||
|
@ -19,7 +19,7 @@ gitbutler-project.workspace = true
|
|||||||
gitbutler-branch.workspace = true
|
gitbutler-branch.workspace = true
|
||||||
gitbutler-serde.workspace = true
|
gitbutler-serde.workspace = true
|
||||||
gitbutler-fs.workspace = true
|
gitbutler-fs.workspace = true
|
||||||
gitbutler-tagged-string.workspace = true
|
gitbutler-reference.workspace = true
|
||||||
|
|
||||||
[[test]]
|
[[test]]
|
||||||
name = "oplog"
|
name = "oplog"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use gitbutler_branch::branch::{Branch, BranchUpdateRequest};
|
use gitbutler_branch::branch::{Branch, BranchUpdateRequest};
|
||||||
use gitbutler_project::Project;
|
use gitbutler_project::Project;
|
||||||
use gitbutler_tagged_string::ReferenceName;
|
use gitbutler_reference::ReferenceName;
|
||||||
use std::vec;
|
use std::vec;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
mod refname;
|
mod refname;
|
||||||
|
use gitbutler_tagged_string::TaggedString;
|
||||||
pub use refname::{LocalRefname, Refname, RemoteRefname, VirtualRefname};
|
pub use refname::{LocalRefname, Refname, RemoteRefname, VirtualRefname};
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
@ -6,3 +7,7 @@ pub fn normalize_branch_name(name: &str) -> String {
|
|||||||
let pattern = Regex::new("[^A-Za-z0-9_/.#]+").unwrap();
|
let pattern = Regex::new("[^A-Za-z0-9_/.#]+").unwrap();
|
||||||
pattern.replace_all(name, "-").to_string()
|
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)
|
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-secret.workspace = true
|
||||||
gitbutler-id.workspace = true
|
gitbutler-id.workspace = true
|
||||||
gitbutler-storage.workspace = true
|
gitbutler-storage.workspace = true
|
||||||
gitbutler-tagged-string.workspace = true
|
|
||||||
open = "5"
|
open = "5"
|
||||||
|
|
||||||
[dependencies.tauri]
|
[dependencies.tauri]
|
||||||
|
@ -10,8 +10,8 @@ pub mod commands {
|
|||||||
use gitbutler_error::error::Code;
|
use gitbutler_error::error::Code;
|
||||||
use gitbutler_project as projects;
|
use gitbutler_project as projects;
|
||||||
use gitbutler_project::ProjectId;
|
use gitbutler_project::ProjectId;
|
||||||
|
use gitbutler_reference::ReferenceName;
|
||||||
use gitbutler_reference::{Refname, RemoteRefname};
|
use gitbutler_reference::{Refname, RemoteRefname};
|
||||||
use gitbutler_tagged_string::ReferenceName;
|
|
||||||
use tauri::{AppHandle, Manager};
|
use tauri::{AppHandle, Manager};
|
||||||
use tracing::instrument;
|
use tracing::instrument;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user