Commit Graph

107 Commits

Author SHA1 Message Date
Kiril Videlov
4ae1847a28 remove core::git::Reference type 2024-06-02 19:03:03 +02:00
Kiril Videlov
879a07da64 remove core::git::Index 2024-06-02 17:57:18 +02:00
Kiril Videlov
e18684fcdb remove the auto detect git flow
It was complex, buggy and slow
2024-06-02 15:48:15 +02:00
Kiril Videlov
5927ca4ac5 remove shell core::git::Config type 2024-06-02 14:26:09 +02:00
Kiril Videlov
1206a504c9 remote git::Remote shell type 2024-06-01 23:30:25 +02:00
Sebastian Thiel
567a077582
simplify core::errors and remove all the cruft 2024-06-01 14:37:41 +02:00
Sebastian Thiel
a10b19ed2c
reomve all thiserror based errors from controllers 2024-06-01 14:36:08 +02:00
Sebastian Thiel
f82d25741e
use Marker in place of Code::ProjectInvalid
That way, the frontend doesn't see internals.
2024-06-01 14:34:16 +02:00
Sebastian Thiel
e7c1d6033a
Remove all errors that don't trigger a custom code or context 2024-06-01 14:34:16 +02:00
Sebastian Thiel
c0fc0cfde5
Remove BranchNotFound struct 2024-06-01 14:34:16 +02:00
Sebastian Thiel
61a53c6346
Another pass at removing ProjectConflict
As this causes quite a lot of changes, there is this commit to capture them.
2024-06-01 14:34:13 +02:00
Sebastian Thiel
1dc52a44c0
restore detection of project conflicts
Previously that variant was removed even though we need it now to
easily detect this case.
2024-06-01 14:32:27 +02:00
Sebastian Thiel
20d84247e9
Prune Code to only what's used by the UI
Also adjust the `Code` documentation to clarify this - otherwise
we will have more and more variants and nobody actually cares.

The frontend code is adjusted as well, as its `Code` counterpart
contained unsused variants which are now removed.
2024-06-01 14:32:27 +02:00
Mattias Granlund
eeb99090ad Fix incorrect workspace_head during merge conflicts
- without this we get an incorrect diff
2024-05-30 12:09:27 +02:00
Kiril Videlov
62a3d02303 remove git::signature shell type 2024-05-29 23:51:26 +02:00
Sebastian Thiel
96dc9d2887
fix oplog-worktree merging 2024-05-29 17:58:54 +02:00
Kiril Videlov
45979b4c85 remove usage of git::Commit 2024-05-29 17:33:57 +02:00
Sebastian Thiel
1abb464845
Merge pull request #3885 from gitbutlerapp/rust-remote-tweaks-for-byron
Tweaks to remotes code
2024-05-29 15:13:02 +02:00
Kiril Videlov
be149a5569 remove git::Tree in favor of just git2::Tree 2024-05-29 14:30:59 +02:00
Kiril Videlov
9e4bbdedec remove unused reader functions 2024-05-29 14:04:51 +02:00
Caleb Owens
faa476875d Replace &BranchId to BranchId 2024-05-29 11:07:36 +02:00
Caleb Owens
0db12b5115 Don't pass references to project_id 2024-05-29 10:47:11 +02:00
Caleb Owens
6d1ed8474c rename fetch_from_target to fetch_from_remotes 2024-05-28 10:14:35 +02:00
Sebastian Thiel
b0e73e5c89
oplog review 2024-05-28 17:22:02 +02:00
Sebastian Thiel
590d713f91
use git2::Oid instead of String; various small refactors 2024-05-28 13:25:46 +02:00
Sebastian Thiel
e3156ba75c
remove single-use traits while leaving the structure as is 2024-05-28 13:25:46 +02:00
Sebastian Thiel
346c96869e
small refactors (see body for details)
- instrument snapshot creation to assure we see errors (which are ignored in code)
- move tests for public `entry` types into integration tests
- rename `OperationType` to `OperationKind` as it's more commmon in Rust
- Use `Copy` where possible
- streamline implementation: remove clones and allocations, without going zero-copy
- Prefer direct calls to traits to avoid `write!("{}")` just to invoke a trait fmt implementation
- avoid `pub` when `pub(crate)` will do
- strong type for created_at
2024-05-28 13:25:46 +02:00
Sebastian Thiel
6224c70695
fix integration test structure to assure tests run only once.
Previously, tests were included by `app.rs` which is the entrypoint
for intgration tests, but there were also loose `.rs` files which
each count as separate test (with their own binary).

This wasn't intended and I don't know what happened there,
so now `core.rs` is the entrypoint.
2024-05-28 13:25:45 +02:00
Caleb Owens
b8a1dcb2f0
Revert "Replace integer timestamps with Duration" 2024-05-24 09:40:52 +01:00
Caleb Owens
4a7e5f48dd Merge origin/master into core-util-duration-updates 2024-05-23 14:04:54 +02:00
Caleb Owens
d55260c96a Use Duration rather than various integer times for time 2024-05-23 14:02:48 +02:00
Kiril Videlov
c7aaa1a6b6 fix oplog test 2024-05-23 13:40:53 +02:00
Mattias Granlund
cd419eca67 Refactor how we merge in commits from branch upstream
- send change_id to frontend for `RemoteCommit`
- split up massive function into three
- add a couple of checks to prevent unexpected state
- rebase if force push allowed (needs toggle)
2024-05-23 10:58:59 +02:00
Mattias Granlund
21e98fd9f2 Simplify getting default target
- remove try function in favor of returning error
- drop unused function
2024-05-21 12:02:38 +02:00
Scott Chacon
18de60740b formatting 2024-05-19 07:24:15 +02:00
Scott Chacon
2a89fa6b93 save and restore the gitbutler/integration branch
when we save the snapshots, save and restore the integration branch commit properly so we don't get in a weird state after restore
2024-05-19 07:07:55 +02:00
Scott Chacon
733780f302 reformat 2024-05-17 15:16:04 +02:00
Scott Chacon
dcc1b37331 rewrite our oplog tests 2024-05-17 15:11:19 +02:00
Scott Chacon
b0c5c07a57
some change-id based tests 2024-05-15 15:21:19 +02:00
Scott Chacon
202c551bc7
remove signing setting 2024-05-14 13:15:11 +02:00
Scott Chacon
d944cad533 merge upstream
temp
2024-05-14 10:25:29 +02:00
Kiril Videlov
81e948774f
fix test 2024-05-12 23:42:04 +02:00
Kiril Videlov
5b3273f542
remove unused sessions / deltas implementation
This is removed in favor of the new `ops` module
2024-05-12 03:39:04 +02:00
Scott Chacon
4d542330c5 merge stuff 2024-05-11 11:43:06 +02:00
Mattias Granlund
e7f25e29c5 Check we are on the right branch in verify_branch
Ensures we don't accidentally run commands while HEAD is pointing to something other than the gitbutler/integration branch.
2024-05-08 12:20:00 +02:00
Scott Chacon
51f9769024 sign commits with real git
in the strangest possible way
2024-05-07 15:15:25 +02:00
Josh Junon
dce8ead62f
use simpler virtual branch handle fetch in tests (and fix strange uncaught compilation error) 2024-05-06 20:22:40 +02:00
Scott Chacon
46fe51eeda fix rust errors 2024-05-06 14:30:25 +02:00
Mattias Granlund
5bb8c25aca Fix bug in updating base branch
- drop "double lock across branches" test because it can't happen
- save correct tree when updating branch states
- use correct integration commit when updating base branch
2024-05-02 17:39:52 +02:00
Scott Chacon
2b1d808314 add several history manipulation backend functions
this adds backend functions in Rust to do the following:
* move file hunks between commits (basic)
* undo any commit in a stack
* insert a blank commit
* move a commit within the stack
* update a commit message in place
2024-04-29 15:03:01 +02:00