Commit Graph

34 Commits

Author SHA1 Message Date
Sebastian Thiel
e6b00b5e0e
more tests and refactors for branch-listing 2024-08-01 15:21:30 +02:00
Sebastian Thiel
b7c38e4f33
fix assumption about branch identity
It's possible for virtual branches to have the same 'identity' as
the target branch, yet they should be listed.
2024-08-01 09:24:35 +02:00
Sebastian Thiel
2d82b6e038
more tests specific to how branches are discovered 2024-07-31 19:44:00 +02:00
Sebastian Thiel
a5bc727705
let integration commit also respect author and committer times. 2024-07-31 18:52:01 +02:00
Sebastian Thiel
76d687b55c
Respect author-date for setting up completely static commmit graphs
This updates to a yet-to-be-released version of `gix` to be able to
leverage full local-time support thanks to the usage of `jiff`.

This means we can now rely on the local `now()` that `gix` signatures
come with, which naturally respect environment variables that help
to make commits statically known.

For the running Tauri application this won't have an effect as it won't
inherit environment variables, but the CLI will be different in that regard.
2024-07-31 18:52:01 +02:00
Mattias Granlund
11f0063f18 Remove test cases that do not apply
To list virtual branches we should require a base branch to be set.
2024-07-30 18:09:07 +01:00
Caleb Owens
21bad4f30f repo -> repository 2024-07-29 11:13:25 +02:00
Caleb Owens
f4569ff4da Yes Kiril, I know its an abrv., but its consistent with what Byron started 2024-07-29 10:46:17 +02:00
Caleb Owens
366ccfecdf Rename ProjectRepository to CommandContext 2024-07-29 10:43:18 +02:00
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
Sebastian Thiel
9e236e3469
remove async except for in gitbutler-git
The reason is that it's unclear if maybe it's there for a good reason,
and I don't want to break the complex code in there.
2024-07-28 20:47:35 +02:00
Sebastian Thiel
7c371e5dd4
More tests to understand more about the current branch-listing.
This also needs the ability to create commits.
Also experiment with `async` tauri commands, but without actually making
them `async` - nothing actually is so why pretend?

Further, assure we get the correct author and committer which helps it
pick up the overridden author information when creating a commit.
2024-07-28 17:12:23 +02:00
Sebastian Thiel
282519eca5
add ability to create add projects in CLI and create vbranches
This allows actual GitButler setups and more complex tests, which
are also added here.
2024-07-28 10:45:18 +02:00
Sebastian Thiel
093795bd0b
first simple test for list_branches and basic read-only test framework 2024-07-27 19:14:15 +02:00
Caleb Owens
7a6c7472a4
Always overwrite local references 2024-07-25 15:49:22 +02:00
Caleb Owens
2f54e51a33 Don't create unrequired wip commits 2024-07-25 15:25:51 +02:00
Caleb Owens
c1c5d88303 Specify the correct branch to be the upstream
asdf
2024-07-25 15:11:07 +02:00
Kiril Videlov
ea4f47da1b
get_applied_status returns VirtualBranchFiles instead of a tuple of path and hunks 2024-07-21 20:12:54 +02:00
Kiril Videlov
9b9bd0b2e8
make virtual.rs functions operate on VirtualBranchHunk
Instead of the Hunk type from gitbutler_diff
2024-07-21 15:38:46 +02:00
Kiril Videlov
591552f625
get_applied_status now returns a more clear struct 2024-07-20 23:00:06 +02:00
Kiril Videlov
587915227d
remove redundant function get_status_by_branch 2024-07-20 22:01:46 +02:00
Kiril Videlov
27561fa7b8
simplify get_applied_status function signature 2024-07-20 21:57:45 +02:00
Kiril Videlov
5d56427f83
Adds error codes for commit failures
This will helps the UI better understand why a commit operation may have failed
2024-07-20 12:54:48 +02:00
Sebastian Thiel
4526006bf9
Show that not all users of get_applied_status need write permissions...
...according to tests.
2024-07-16 17:33:53 +02:00
Sebastian Thiel
613a773c77
fix remaining tests that depend on the auto-creation of vbranches 2024-07-15 22:36:44 +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
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
Sebastian Thiel
5e408f6b2d
Assure a single path to an item (struct, fn)
Also, simplify paths and optimize them (to some extend) to seem
non-redundant when `use`ing them.
2024-07-14 21:32:55 +02:00
Sebastian Thiel
0079f2bcbe
minimize the public API of gitbutler-branch-actions crate.
Also avoid private traits where functions would be easier to use.
2024-07-14 21:32:54 +02:00
Caleb Owens
ca4cdfe968
Split branch manager into seperate traits 2024-07-10 17:23:50 +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
c8658b9a23
rename gitbutler-virtual to gitbutler-branch-actions
This is to establish a patter of which crates represent a higher level logic
2024-07-10 14:49:48 +02:00