Commit Graph

26 Commits

Author SHA1 Message Date
Sebastian Thiel
39099ba41c
run the nightly cargo fmt with pnpm fmt
This also optimizes imports/uses, which is done only occasionally.
2024-07-28 21:02:40 +02:00
Kiril Videlov
0e9b8c2957
fixes a situation in which listing of snapshots fails 2024-07-20 15:51:46 +02:00
Kiril Videlov
ea5079b723
oplog - get a workdir tree in a safe manner 2024-07-20 14:31:43 +02:00
Kiril Videlov
6101c5c66f
move hunk and diff code to a separate crate, out of the branch one 2024-07-17 20:16:48 +02:00
Sebastian Thiel
822fd92b9d
Enforce locking by making locks part of the public oplog API.
This way, all methods that care about the `oplog` also have to
care about choosing the right lock.
2024-07-15 21:09:33 +02:00
Sebastian Thiel
09ca2d0284
enforce in-process-synchronization during worktree updates and prolonged reads in oplog
That way it's assured that reads and writes don't intersect, but assure we only
hold such lock for the shortest amount of time for reads and and for the
full duration of writes.
2024-07-15 14:21:15 +02:00
Sebastian Thiel
3e79238e7f
assure conflicts::mark() writes its file atomically
That way it can't be observed half-written, or remain in a half-written
state in case of crash.
2024-07-15 08:20:06 +02:00
Sebastian Thiel
4a7b63a56e
various refactors in main functions called during project load
* use `ctx` as name instead of `project_repository` to make lines shorter
  and more readable. This could be done everywhere once the type-name changes
  as well.
* Where possible, avoid using `&self` for `VirtualBranchActions` as there is no state.
  For now I avoided to remove its usage as field in the filesystem monitor.
* Use a more modern way to use state in `tauri` commands.
* Add the `Ext` suffix to what clearly is extension traits.
2024-07-14 21:32:55 +02:00
Sebastian Thiel
f48d0e2746
adapt to changes in gitbutler-branch crate 2024-07-14 21:32:55 +02:00
Kiril Videlov
87f956d871
move ReferenceName tagged string to gitbutler-reference crate
gitbutler-reference is where ReferenceName belongs. There are other thing in this crate that are not nice, but let's clean those up!
2024-07-10 16:48:59 +02:00
Kiril Videlov
e92fe44fa1
move branch state into the gitbutler-branch crate
Further to the move - the VirtualBranchesExt trait creates a dependency towards gitbutler-project. The gitubler-branch crate doesn't have such dependency so i deemed it undesirable to introduce it just for a convinience method. 
(Separately added an extention in gitbutler-virtual-actions since it already depends on project and to create a smaller diff)
2024-07-10 16:18:34 +02:00
Kiril Videlov
da67580c80
Rename VirtualBrancesAccess to _Ext since it's the convention
After discussing it, seems like a better way of naming this is to use the Ext convention
2024-07-10 12:54:22 +02:00
Caleb Owens
9b59764db3
Split branch creation and deletion into their own home 2024-07-09 16:47:24 +02:00
Kiril Videlov
cdec47154d
remove references to gitbutler-core 2024-07-09 15:56:57 +02:00
Kiril Videlov
3be7d600e0
move fs and storage intor separate crates 2024-07-09 12:54:08 +02:00
Kiril Videlov
944b63c647
move serde functions into their own crate 2024-07-09 11:49:12 +02:00
Kiril Videlov
0b1ecf7b54
move virtual branch constatns out of the core create 2024-07-09 00:45:10 +02:00
Kiril Videlov
acee9ba5ab
move branch related modules to separate crate
Unfortunatelly diff and branch types form a cyclical dependency via the "HunkLock" type. This will have to be refactored as a followup
2024-07-09 00:10:55 +02:00
Kiril Videlov
ba5b9ff0ee
Merge branch 'master' into extract-project-from-core-into-its-onw-crate 2024-07-08 17:57:17 +02:00
Kiril Videlov
e93896621f
move project module in a separate gitbutler-project crate 2024-07-08 15:33:26 +02:00
Caleb Owens
066d6d2437
Rename 'list_branches' to convey more meaning 2024-07-08 14:58:31 +02:00
Caleb Owens
54744ef78c
Remove more remnents of unapplied branches 2024-07-08 14:58:28 +02:00
Kiril Videlov
7ac2d3a619
move repository ext trait to gitbutler-repo crate 2024-07-08 12:21:01 +02:00
Kiril Videlov
00a77d9327
move branch state into a separate crate 2024-07-07 21:26:07 +02:00
Kiril Videlov
71809fc882
remove project dependency on oplog 2024-07-07 21:10:31 +02:00
Kiril Videlov
c36f67f148
move oplog to its own crate
This protects us from cyclic dependencies. Unfortunatelly as part of this, i had to introduce the imp Project as trait implementations since now Project is foreign
2024-07-07 20:00:01 +02:00