Commit Graph

86 Commits

Author SHA1 Message Date
Kiril Videlov
87a4c61b9f Consistent setting of stack head updating the series 2024-10-08 22:25:19 +02:00
Kiril Videlov
34ca1f4a65 Merge master into refactor Branch and Stack 2024-10-08 19:40:17 +02:00
Kiril Videlov
cfafc8d7b5 Make all places that create Stack also initialize it 2024-10-08 16:43:42 +02:00
Kiril Videlov
48bbe13d56 Rename StackExt.new to create 2024-10-08 16:37:07 +02:00
Kiril Videlov
ce9b136185 Rename Stack constructor function to new_uninitialized
This describes it more accurately
2024-10-08 16:05:23 +02:00
Kiril Videlov
d05d962cf8 Rename Branch to Stack 2024-10-08 15:59:27 +02:00
Caleb Owens
99145f4aa4 Redo branch upstream integration 2024-10-08 15:49:58 +02:00
Kiril Videlov
9e9f3255a8 Remove some types out of the stack crate
Seems i can get away without adding it
2024-10-08 15:44:59 +02:00
Kiril Videlov
7ec59f8489 extract the Branch types to crate gitbutler-stack 2024-10-08 15:27:16 +02:00
Kiril Videlov
5b7109e8ee refactor(Branch): implement set_head() and make field private
This allows us to control the head setting and update the stack `heads` field accordingly
2024-10-08 12:21:57 +02:00
Caleb Owens
8f9fd0cbe7 Extract branch_upstream_integration into it's own file 2024-10-07 18:02:21 +02:00
Caleb Owens
45fbb1af76 Remove old update_base_branch code 2024-10-07 17:46:28 +02:00
Caleb Owens
531672876f Remove edit mode flag from backend 2024-10-07 17:08:32 +02:00
Caleb Owens
82406810f0 Extract tree updating into its own tested function 2024-10-07 16:10:34 +02:00
estib
d8b2bee18c fix: Lint errors 2024-10-04 10:35:17 +02:00
estib
c804699fd1 move commit: Check whether the commit is locked to it's ancestors
If the commit being moved depends on changes made in any of the ancestor commits, raise an error.

Add integration tests for that
2024-10-02 18:57:54 +02:00
estib
337096a254 move commit: Add tests for multiple commits
- Add tests for moving commits in between branches that have exisiting commits in them
- Assert the contents of the commit and uncommitted files
2024-10-02 12:00:02 +02:00
Caleb Owens
a468ec7783 Added the tests 2024-10-01 17:12:46 +02:00
Caleb Owens
9cbebba5cf
Fix testcase for merge_vbranch_upstream_clean_rebase 2024-09-25 15:15:29 +02:00
Caleb Owens
cc8d3f4810 Did shit good 2024-09-16 16:42:23 +02:00
Caleb Owens
edd0cbe0e6 Rename unapplying 2024-09-13 16:58:42 +02:00
Kiril Videlov
310d4cf73a
fix a bug where deleting a vbranch fails to update state 2024-09-10 10:55:36 +02:00
Kiril Videlov
df4d6ac099
fixes a test that should be using writable fixture 2024-09-06 15:18:09 +02:00
Kiril Videlov
95e946b8a1
Remove unnecessary VirtualBranchActions struct 2024-09-06 14:12:14 +02:00
Mattias Granlund
260e81a94e Use simpler function for asserting workspace is open. 2024-09-02 20:53:19 +03:00
Mattias Granlund
85ebc4ea78 Add test to ensure old integration branch doesn't throw 2024-09-02 20:53:19 +03:00
Mattias Granlund
0db82ea38c Replace all relevant occurrences of integration with workspace 2024-09-02 20:53:19 +03:00
Mattias Granlund
9acab668cc Fix broken test
- make use of integration commit title constant
2024-09-02 20:53:19 +03:00
Mattias Granlund
5f9c2e5832 Rename gitbutler/integration -> gitbutler/workspace 2024-09-02 20:53:19 +03:00
Sebastian Thiel
4d495cb3bc
Adjust integration check to also recognize by matching tree.
This is relevant when all commits are equal by tree, but seem changed
due to the added GitButler headers.

For added safety, we also compare by commit message, date and authors,
basically everything that isn't the headers.
2024-08-30 07:15:47 +02:00
Sebastian Thiel
36f23d529f
CLI with branch list-remotes to list remote branches 2024-08-30 07:15:46 +02:00
Sebastian Thiel
7ce143954f
Do not dynamically calculate the head commit when listing virtual branches.
That way, the head is static which allows to re-use the worktree status across
multiple related calls.

Also, add a way to quickly get the `head_commit()` from a `git2::Repository`.

Note that this may cause breakage in the app, as now it will see the actual
head, not a computed one, but that should also help us to find places that
didn't properly update their state.
2024-08-28 21:16:43 +02:00
Sebastian Thiel
7e0878a14f
Use read-only worktree diff
The worktree diff is essentially a 'git status' with a given tree,
and that can be expressed with a diff of the workdir, the index and a tree.

This comes at the expense of not being able to control which file sizes are diffed.
2024-08-28 11:10:04 +02:00
Caleb Owens
ec7a38f538
Merge pull request #4717 from gitbutlerapp/Rebase-revolution
Rebase revolution
2024-08-22 18:28:49 +02:00
Sebastian Thiel
0db0f1a86a
Use gix for simple ref-walk that won't go past the merge-base. 2024-08-21 19:28:12 +02:00
Sebastian Thiel
db600b48f9
add benchmark just for revwalking 2024-08-21 19:28:11 +02:00
Sebastian Thiel
7362bab7aa
Assure we can use different merge bases when showing branch details.
Alternatively, correct the assumption that there is a difference.
2024-08-21 19:28:11 +02:00
Sebastian Thiel
07dc9efe02
add tests for get_branch_listing_details() 2024-08-21 19:28:11 +02:00
Sebastian Thiel
e26bf2f54a
add benchmarks for branch details 2024-08-21 19:28:09 +02:00
Caleb Owens
65fb462d64 Rebase revolution
Co-authored-by: Scott <schacon@gmail.com>
2024-08-19 18:10:28 +02:00
Sebastian Thiel
4c76e2a6ee
Revert "Revert "Merge pull request #4652 from gitbutlerapp/git2-to-gix""
This reverts commit 88496e6219.
2024-08-09 10:30:52 +02:00
Kiril Videlov
88496e6219 Revert "Merge pull request #4652 from gitbutlerapp/git2-to-gix"
This reverts commit ae8b05ae70, reversing
changes made to 4d9b6a4a93.
2024-08-09 10:18:51 +02:00
Sebastian Thiel
6720e987fe
Use gix::refs::PartialName as even stronger guarantee for what's in there 2024-08-08 21:04:09 +02:00
Sebastian Thiel
712ce582cb
Use BranchIdentity type instead of given_name().
This is a change in perception, as `given_name()` was the name of a virtual-branch,
which is also used to correlate other similarly named branches.

Thus, it's now more than just that, and for lack of a better word it's called
the 'identity' of a branch.

It's something very specific and shouldn't accidentally be used wrongly, hence
the strong typing.
2024-08-08 20:53:15 +02:00
Sebastian Thiel
3df2da6de5
Use gix::remote::Name for type-safety. 2024-08-08 20:53:14 +02:00
Sebastian Thiel
17850bd210
Use gix for branch listing 2024-08-07 20:21:29 +02:00
Sebastian Thiel
e42fcd4643
add benchmark for branch-listing 2024-08-07 20:10:02 +02:00
Sebastian Thiel
e8cc7f9f03
make the notion of identity typesafe. 2024-08-05 20:01:00 +02:00
Caleb Owens
c35787a848 fix rust tests 2024-08-05 14:17:46 +02:00
Caleb Owens
aec1bda197 stuff 2024-08-05 11:37:39 +02:00