mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 15:31:19 +02:00
Move a bunch of git ops to use the git binary (#302)
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
use crate::add::git_add;
|
||||
use crate::branch::{git_checkout_branch, git_create_branch, git_delete_branch, git_merge_branch};
|
||||
use crate::commit::git_commit;
|
||||
use crate::credential::git_add_credential;
|
||||
use crate::error::Result;
|
||||
use crate::fetch::git_fetch_all;
|
||||
use crate::git::{
|
||||
git_add, git_commit, git_init, git_log, git_status, git_unstage, GitCommit, GitStatusSummary,
|
||||
};
|
||||
use crate::pull::{git_pull, PullResult};
|
||||
use crate::push::{git_push, PushResult};
|
||||
use crate::init::git_init;
|
||||
use crate::log::{GitCommit, git_log};
|
||||
use crate::pull::{PullResult, git_pull};
|
||||
use crate::push::{PushResult, git_push};
|
||||
use crate::remotes::{GitRemote, git_add_remote, git_remotes, git_rm_remote};
|
||||
use crate::status::{GitStatusSummary, git_status};
|
||||
use crate::unstage::git_unstage;
|
||||
use std::path::{Path, PathBuf};
|
||||
use tauri::command;
|
||||
|
||||
// NOTE: All of these commands are async to prevent blocking work from locking up the UI
|
||||
|
||||
#[command]
|
||||
@@ -80,3 +86,28 @@ pub async fn unstage(dir: &Path, rela_paths: Vec<PathBuf>) -> Result<()> {
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub async fn add_credential(
|
||||
dir: &Path,
|
||||
remote_url: &str,
|
||||
username: &str,
|
||||
password: &str,
|
||||
) -> Result<()> {
|
||||
git_add_credential(dir, remote_url, username, password).await
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub async fn remotes(dir: &Path) -> Result<Vec<GitRemote>> {
|
||||
git_remotes(dir)
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub async fn add_remote(dir: &Path, name: &str, url: &str) -> Result<GitRemote> {
|
||||
git_add_remote(dir, name, url)
|
||||
}
|
||||
|
||||
#[command]
|
||||
pub async fn rm_remote(dir: &Path, name: &str) -> Result<()> {
|
||||
git_rm_remote(dir, name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user