Skip to content

Commit cb0f4f9

Browse files
committed
Drop some bleep code
1 parent f85d18c commit cb0f4f9

File tree

4 files changed

+2
-106
lines changed

4 files changed

+2
-106
lines changed

apps/desktop/src/lib/history/syncedSnapshotService.ts

Lines changed: 0 additions & 53 deletions
This file was deleted.

crates/gitbutler-sync/src/cloud.rs

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,15 @@ use anyhow::{anyhow, Context, Result};
77
use gitbutler_command_context::CommandContext;
88
use gitbutler_error::error::Code;
99
use gitbutler_id::id::Id;
10-
use gitbutler_oplog::{
11-
entry::{OperationKind, SnapshotDetails},
12-
OplogExt,
13-
};
10+
use gitbutler_oplog::OplogExt;
1411
use gitbutler_project as projects;
1512
use gitbutler_project::{CodePushState, Project};
1613
use gitbutler_reference::Refname;
17-
use gitbutler_stack::{StackId, Target, VirtualBranchesHandle};
14+
use gitbutler_stack::{Target, VirtualBranchesHandle};
1815
use gitbutler_url::Url;
1916
use gitbutler_user as users;
2017
use itertools::Itertools;
2118

22-
pub fn take_synced_snapshot(
23-
ctx: &CommandContext,
24-
user: &users::User,
25-
stack_id: Option<StackId>,
26-
) -> Result<git2::Oid> {
27-
let project = ctx.project();
28-
let mut guard = project.exclusive_worktree_access();
29-
30-
let virtual_branches_handle = VirtualBranchesHandle::new(project.gb_dir());
31-
if let Some(stack_id) = stack_id {
32-
let mut stack = virtual_branches_handle.get_stack_in_workspace(stack_id)?;
33-
stack.post_commits = true;
34-
virtual_branches_handle.set_stack(stack)?;
35-
}
36-
37-
let snapshot = ctx.create_snapshot(
38-
SnapshotDetails::new(OperationKind::SyncWorkspace),
39-
guard.write_permission(),
40-
)?;
41-
push_oplog(ctx, user)?;
42-
43-
if let Some(stack_id) = stack_id {
44-
let mut stack = virtual_branches_handle.get_stack_in_workspace(stack_id)?;
45-
stack.post_commits = true;
46-
virtual_branches_handle.set_stack(stack)?;
47-
}
48-
49-
Ok(snapshot)
50-
}
51-
5219
/// Pushes the repository to the GitButler remote
5320
pub fn push_repo(
5421
ctx: &CommandContext,

crates/gitbutler-tauri/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ fn main() {
250250
undo::list_snapshots,
251251
undo::restore_snapshot,
252252
undo::snapshot_diff,
253-
undo::take_synced_snapshot,
254253
undo::oplog_diff_worktrees,
255254
config::get_gb_config,
256255
config::set_gb_config,

crates/gitbutler-tauri/src/undo.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use gitbutler_oplog::entry::OperationKind;
99
use gitbutler_oplog::{entry::Snapshot, OplogExt};
1010
use gitbutler_project as projects;
1111
use gitbutler_project::ProjectId;
12-
use gitbutler_stack::StackId;
13-
use gitbutler_user::User;
1412
use tauri::State;
1513
use tracing::instrument;
1614

@@ -70,21 +68,6 @@ pub fn snapshot_diff(
7068
Ok(diff)
7169
}
7270

73-
#[tauri::command(async)]
74-
#[instrument(skip(projects, settings), err(Debug))]
75-
pub fn take_synced_snapshot(
76-
projects: State<'_, projects::Controller>,
77-
settings: State<'_, AppSettingsWithDiskSync>,
78-
project_id: ProjectId,
79-
user: User,
80-
stack_id: Option<StackId>,
81-
) -> Result<String, Error> {
82-
let project = projects.get(project_id).context("failed to get project")?;
83-
let ctx = CommandContext::open(&project, settings.get()?.clone())?;
84-
let snapshot_oid = gitbutler_sync::cloud::take_synced_snapshot(&ctx, &user, stack_id)?;
85-
Ok(snapshot_oid.to_string())
86-
}
87-
8871
#[tauri::command(async)]
8972
#[instrument(skip(projects, settings), err(Debug))]
9073
pub fn oplog_diff_worktrees(

0 commit comments

Comments
 (0)