Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions apps/desktop/src-tauri/src/commands/commit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use git::{
core::get_services,
models::commit::{CommitInfo, CommitMessage, FullCommitInfo},
models::commit::{Author, CommitInfo, CommitMessage, FullCommitInfo},
AppState,
};

Expand Down Expand Up @@ -28,11 +28,22 @@ pub async fn create_commit(
context_id: String,
commit_meta: CommitMessage,
allow_empty: bool,
amend: bool,
expected_head: Option<String>,
state: tauri::State<'_, AppState>,
) -> Result<String, String> {
let services = get_services(state, &context_id).await?;
services
.commit()
.create_commit(&commit_meta, allow_empty)
.create_commit(&commit_meta, allow_empty, amend, expected_head.as_deref())
.await
}

#[tauri::command]
pub async fn commit_authors(
context_id: String,
state: tauri::State<'_, AppState>,
) -> Result<Vec<Author>, String> {
let services = get_services(state, &context_id).await?;
services.commit().commit_authors().await
}
6 changes: 3 additions & 3 deletions apps/desktop/src-tauri/src/commands/rebase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub async fn rebase_update_todo(
state: tauri::State<'_, AppState>,
) -> Result<RepoOperation, String> {
let services = get_services(state, &context_id).await?;
services.rebase().update_todo(request.entries)
services.rebase().update_todo(request.entries).await
}

#[tauri::command]
Expand All @@ -98,7 +98,7 @@ pub async fn rebase_set_commit_message(
state: tauri::State<'_, AppState>,
) -> Result<(), String> {
let services = get_services(state, &context_id).await?;
services.rebase().set_commit_message(&message)
services.rebase().set_commit_message(&message).await
}

#[tauri::command]
Expand All @@ -108,5 +108,5 @@ pub async fn rebase_resolve_conflict(
state: tauri::State<'_, AppState>,
) -> Result<(), String> {
let services = get_services(state, &context_id).await?;
services.rebase().resolve_conflict(request)
services.rebase().resolve_conflict(request).await
}
1 change: 1 addition & 0 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ pub fn run() {
commands::commit::last_commit,
commands::commit::commit_by_id,
commands::commit::create_commit,
commands::commit::commit_authors,
commands::branch::push,
commands::branch::publish_branch,
commands::branch::pull,
Expand Down
Loading
Loading