mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 20:54:50 +03:00
Merge pull request #4283 from gitbutlerapp/move-author-and-askpass-mods
move author and askpass mods
This commit is contained in:
commit
a8615f81f1
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -2336,7 +2336,9 @@ dependencies = [
|
|||||||
"gitbutler-project",
|
"gitbutler-project",
|
||||||
"gitbutler-testsupport",
|
"gitbutler-testsupport",
|
||||||
"gitbutler-user",
|
"gitbutler-user",
|
||||||
|
"log",
|
||||||
"resolve-path",
|
"resolve-path",
|
||||||
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use futures::future::join_all;
|
use futures::future::join_all;
|
||||||
use gitbutler_core::virtual_branches::Author;
|
|
||||||
use gitbutler_user as users;
|
use gitbutler_user as users;
|
||||||
use std::{collections::HashMap, path, sync, time::Duration};
|
use std::{collections::HashMap, path, sync, time::Duration};
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
author::Author,
|
||||||
base::BaseBranch,
|
base::BaseBranch,
|
||||||
remote::{RemoteBranchData, RemoteCommit},
|
remote::{RemoteBranchData, RemoteCommit},
|
||||||
VirtualBranch, VirtualBranchCommit,
|
VirtualBranch, VirtualBranchCommit,
|
||||||
|
@ -16,3 +16,5 @@ pub mod files;
|
|||||||
pub mod remote;
|
pub mod remote;
|
||||||
|
|
||||||
pub mod conflicts;
|
pub mod conflicts;
|
||||||
|
|
||||||
|
mod author;
|
||||||
|
@ -8,7 +8,9 @@ use gitbutler_repo::{LogUntil, RepoActions, RepositoryExt};
|
|||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use gitbutler_core::git::{self, CommitExt};
|
use gitbutler_core::git::{self, CommitExt};
|
||||||
use gitbutler_core::virtual_branches::{target, Author};
|
use gitbutler_core::virtual_branches::target;
|
||||||
|
|
||||||
|
use crate::author::Author;
|
||||||
|
|
||||||
// this struct is a mapping to the view `RemoteBranch` type in Typescript
|
// this struct is a mapping to the view `RemoteBranch` type in Typescript
|
||||||
// found in src-tauri/src/routes/repo/[project_id]/types.ts
|
// found in src-tauri/src/routes/repo/[project_id]/types.ts
|
||||||
|
@ -19,10 +19,10 @@ use diffy::{apply_bytes as diffy_apply, Line, Patch};
|
|||||||
use git2::build::TreeUpdateBuilder;
|
use git2::build::TreeUpdateBuilder;
|
||||||
use git2::ErrorCode;
|
use git2::ErrorCode;
|
||||||
use git2_hooks::HookResult;
|
use git2_hooks::HookResult;
|
||||||
use gitbutler_core::virtual_branches::Author;
|
|
||||||
use hex::ToHex;
|
use hex::ToHex;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
use crate::author::Author;
|
||||||
use crate::conflicts::{self, RepoConflicts};
|
use crate::conflicts::{self, RepoConflicts};
|
||||||
use crate::integration::{get_integration_commiter, get_workspace_head};
|
use crate::integration::{get_integration_commiter, get_workspace_head};
|
||||||
use crate::remote::{branch_to_remote_branch, RemoteBranch};
|
use crate::remote::{branch_to_remote_branch, RemoteBranch};
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
clippy::too_many_lines
|
clippy::too_many_lines
|
||||||
)]
|
)]
|
||||||
|
|
||||||
pub mod askpass;
|
|
||||||
pub mod dedup;
|
pub mod dedup;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
|
@ -2,9 +2,6 @@ pub mod branch;
|
|||||||
pub use branch::{Branch, BranchId};
|
pub use branch::{Branch, BranchId};
|
||||||
pub mod target;
|
pub mod target;
|
||||||
|
|
||||||
mod author;
|
|
||||||
pub use author::Author;
|
|
||||||
|
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref GITBUTLER_INTEGRATION_REFERENCE: crate::git::LocalRefname =
|
pub static ref GITBUTLER_INTEGRATION_REFERENCE: crate::git::LocalRefname =
|
||||||
|
@ -14,6 +14,8 @@ tokio = { workspace = true, features = [ "rt-multi-thread", "rt", "macros" ] }
|
|||||||
gitbutler-git.workspace = true
|
gitbutler-git.workspace = true
|
||||||
tracing = "0.1.40"
|
tracing = "0.1.40"
|
||||||
tempfile = "3.10"
|
tempfile = "3.10"
|
||||||
|
serde = { workspace = true, features = ["std"]}
|
||||||
|
log = "^0.4"
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
resolve-path = "0.1.0"
|
resolve-path = "0.1.0"
|
||||||
gitbutler-command-context.workspace = true
|
gitbutler-command-context.workspace = true
|
||||||
|
@ -3,7 +3,7 @@ use std::{collections::HashMap, path::Path, sync::Arc};
|
|||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
use tokio::sync::{oneshot, Mutex};
|
use tokio::sync::{oneshot, Mutex};
|
||||||
|
|
||||||
use crate::{id::Id, virtual_branches::BranchId};
|
use gitbutler_core::{id::Id, virtual_branches::BranchId};
|
||||||
|
|
||||||
static mut GLOBAL_ASKPASS_BROKER: Option<AskpassBroker> = None;
|
static mut GLOBAL_ASKPASS_BROKER: Option<AskpassBroker> = None;
|
||||||
|
|
@ -14,3 +14,5 @@ pub mod credentials;
|
|||||||
mod config;
|
mod config;
|
||||||
|
|
||||||
pub use config::Config;
|
pub use config::Config;
|
||||||
|
|
||||||
|
pub mod askpass;
|
||||||
|
@ -4,14 +4,13 @@ use anyhow::{anyhow, Context, Result};
|
|||||||
|
|
||||||
use gitbutler_command_context::ProjectRepo;
|
use gitbutler_command_context::ProjectRepo;
|
||||||
use gitbutler_core::{
|
use gitbutler_core::{
|
||||||
askpass,
|
|
||||||
error::Code,
|
error::Code,
|
||||||
git::{self, CommitHeadersV2},
|
git::{self, CommitHeadersV2},
|
||||||
ssh,
|
ssh,
|
||||||
virtual_branches::{Branch, BranchId},
|
virtual_branches::{Branch, BranchId},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::Config;
|
use crate::{askpass, Config};
|
||||||
use gitbutler_project::AuthKey;
|
use gitbutler_project::AuthKey;
|
||||||
|
|
||||||
use crate::{credentials::Helper, RepositoryExt};
|
use crate::{credentials::Helper, RepositoryExt};
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
pub mod commands {
|
pub mod commands {
|
||||||
use gitbutler_core::{
|
use gitbutler_core::id::Id;
|
||||||
askpass::{self, AskpassRequest},
|
use gitbutler_repo::askpass::{self, AskpassRequest};
|
||||||
id::Id,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[tauri::command(async)]
|
#[tauri::command(async)]
|
||||||
#[tracing::instrument(skip(response))]
|
#[tracing::instrument(skip(response))]
|
||||||
|
@ -82,7 +82,7 @@ fn main() {
|
|||||||
// SAFETY(qix-): This is safe because we're initializing the askpass broker here,
|
// SAFETY(qix-): This is safe because we're initializing the askpass broker here,
|
||||||
// SAFETY(qix-): before any other threads would ever access it.
|
// SAFETY(qix-): before any other threads would ever access it.
|
||||||
unsafe {
|
unsafe {
|
||||||
gitbutler_core::askpass::init({
|
gitbutler_repo::askpass::init({
|
||||||
let handle = app_handle.clone();
|
let handle = app_handle.clone();
|
||||||
move |event| {
|
move |event| {
|
||||||
handle.emit_all("git_prompt", event).expect("tauri event emission doesn't fail in practice")
|
handle.emit_all("git_prompt", event).expect("tauri event emission doesn't fail in practice")
|
||||||
|
Loading…
Reference in New Issue
Block a user