Commit Graph

17 Commits

Author SHA1 Message Date
Mattias Granlund
90cf617a4f Add test for locking hunk to two different commits 2024-04-24 08:15:01 +01:00
Mattias Granlund
5134460875 Tighten locking tests
- with blame based lock a change can touch a committed line, but not overlap
2024-04-24 08:15:01 +01:00
Mattias Granlund
8140afb88b Use adjacent hunks in commit/lock detection test
We still need to fix the off-by-one bug affecting hunk end lines. When we add start_line + line_count we end up with an extra line. For example, with start_line 1, and line_count 1, the range is 1:1, not 1:2.
2024-04-24 08:15:01 +01:00
Mattias Granlund
811f0ee35b Blame across workspace instead of by branch
- refactors `update_gitbutler_integration`
- creates new `get_workspace_head` function
- ignore locking when resolving merge conflicts
2024-04-24 08:15:01 +01:00
Sebastian Thiel
aa3d3cb7da fix rustfmt formatting issues due to line-length (#3039)
The trick is to temporarily set `max_width` in `rustfmt.toml` to 120,
then set it back to the default of 100 (or remove the file).
2024-04-23 12:53:56 +02:00
Sebastian Thiel
b60d49f752 a clear error message when bare repositories are encountered and rejected (#2704)
This also rewrites some other checks in preference of opening the git directory
in isolation. Doing so is very fast, and the only way to know for certain if a
repository is bare.

In future, once the repository is more separated from the worktree (in terms of mindset)
it should be possible to handle bare repos with worktrees as well.
2024-04-22 11:01:07 +02:00
Sebastian Thiel
27714d8e0d
Adjust GitHunk to not require UTF8 for diffs
This will make the diffing engine more correct overall, as only for
display there will be a potentially lossy conversion.

This will also prevent it to be considered binary even though it is not.
2024-04-21 11:35:25 +02:00
Kiril Videlov
0fea544cd7
rm gb_repository from controller 2024-04-21 09:26:34 +02:00
Josh Junon
d091a357be
fix cargo warnings 2024-04-18 15:43:58 +02:00
Sebastian Thiel
ccbe8fd738
improved error message when worktrees are encountered upon project-add (#3062)
Note that this is a first step towards making worktree support possible.
2024-04-17 18:37:20 +02:00
Sebastian Thiel
a482473453
add a test to core that should work when worktrees are properly supported (#3062)
This reproduces #3062.
2024-04-17 17:32:34 +02:00
Kiril Videlov
6f0fe2afa9 rm uses_diff_context from list vbranches return 2024-04-17 07:14:43 +02:00
daniilS
e12e741c2e Fix typos in "conflict" in error message, comments, and a variable name 2024-04-16 15:40:14 +01:00
Sebastian Thiel
906bfa3cf4
use the new testsupport crate 2024-04-09 20:45:17 +02:00
Sebastian Thiel
d0db6a67df
use the new 'app' error type everywhere 2024-04-01 16:19:09 +02:00
Sebastian Thiel
72291ce4cb
chore: align 'app' and 'lib' crates imports.
This is done one-time (for now) using a nightly feature of cargo-fmt
as defined in `rustfmt-nightly.toml.`

It's planned to make this the default so imports will always be sorted.
For now it can be run manually with:
    cargo +nightly fmt -- --config-path rustfmt-nightly.toml
or
    pnpm rustfmtTBD
 Please enter the message for your patch. Lines starting with
2024-03-30 22:43:16 +01:00
Sebastian Thiel
26c39f2a3f
chore: move library from top-level to gitbutler-core
This better expresses what it does, and leaves the `gitbutler-app`
in the top-level where it can serve as visible entrypoint.
2024-03-30 22:39:21 +01:00