Commit Graph

75 Commits

Author SHA1 Message Date
Nikita Galaiko
6ab278a67c make clippy happy 2023-10-04 12:59:49 +02:00
Nikita Galaiko
f831cb346d refactor: package test initiaion 2023-10-04 12:50:16 +02:00
Nikita Galaiko
13eb5e987e project repository owns project 2023-10-03 15:52:08 +02:00
Nikita Galaiko
550ff26ac7 remove user storage dependency from gb repo 2023-10-03 15:48:49 +02:00
Nikita Galaiko
9faf08e47f
Merge pull request #1279 from gitbutlerapp/Refactor-reader-struct
refactor: use content that is either utf8, large or binary
2023-10-03 12:20:32 +02:00
Nikita Galaiko
f5758371a5 cargo fmt 2023-10-03 12:00:18 +02:00
Nikita Galaiko
30e6026785 fix: pass diff_opts parameter to diff_tree_to_tree function call in trees function 2023-10-03 11:57:39 +02:00
Nikita Galaiko
a0ace30025 implement more From traits for Content 2023-10-03 10:36:43 +02:00
Nikita Galaiko
77bffe638a make git::Blob wrapper 2023-10-03 10:35:43 +02:00
Nikita Galaiko
95304c1968 refactor: use content that is either utf8, large or binary 2023-10-03 10:04:30 +02:00
Kiril Videlov
75bf521bd2 reorder credentials list for performance (if key generated, private_key will fail, so putting it last 2023-09-29 17:14:10 +02:00
Nikita Galaiko
bbbd363870
Merge pull request #1258 from gitbutlerapp/Add-debugging-logs
chore: refactor hunks_by_filepath function to simplify code and impro…
2023-09-29 11:12:13 +02:00
Nikita Galaiko
ea097b7d8b chore: handle errors when converting line content to UTF-8 in hunks_by_filepath function 2023-09-29 11:05:48 +02:00
Nikita Galaiko
644a4ae3f3 chore: refactor hunks_by_filepath function to simplify code and improve readability 2023-09-29 11:02:34 +02:00
Nikita Galaiko
6019f25191 fix: handle both links in and outside the repo 2023-09-29 10:38:52 +02:00
Nikita Galaiko
d77123b775 fix: remove unnecessary steps in creating symlink content
The code previously included unnecessary steps to make the symlink target path relative and convert it to a byte array. These steps have been removed as they are not needed for creating the symlink content.
2023-09-29 09:47:17 +02:00
Nikita Galaiko
110db1bf85 chore: update dependencies and remove sentry-anyhow from Cargo.toml
The changes in this commit update the dependencies in the Cargo.toml file and remove the sentry-anyhow package. The sentry-anyhow package is no longer needed as it has been replaced by the sentry package. This change simplifies the dependencies and ensures that the project is using the latest versions of the required packages.
2023-09-29 09:08:16 +02:00
Nikita Galaiko
7c725a4a9f structured logging 2023-09-29 08:40:21 +02:00
Nikita Galaiko
fb4fb7ad06 improve sentry integration 2023-09-29 08:11:03 +02:00
Nikita Galaiko
8ac716e44b fix allowlist 2023-09-28 14:27:49 +02:00
Nikita Galaiko
80f43ffe32 chore: update build scripts to include separate build commands for nightly and development modes 2023-09-28 13:31:40 +02:00
Nikita Galaiko
e3415c0b6b fix: hunk equiality 2023-09-27 12:02:30 +02:00
Nikita Galaiko
61544a003c feat: add ability to unapply ownership for a hunk in the client
The changes in this commit add support for unapplying ownership for a hunk in the client. This allows users to discard changes made to a specific hunk and revert it back to its original state. The unapplyHunk method is added to the BranchController class, which sends a request to the server to unapply the ownership of the hunk. Upon successful unapplying, the virtual branch store is reloaded to reflect the changes.
2023-09-27 10:23:53 +02:00
Nikita Galaiko
114e4135ee
Merge pull request #1245 from gitbutlerapp/add-test-for-parse-ownership-tricky-file-name
fix: improve parsing of ownership ranges in FileOwnership struct
2023-09-26 14:23:15 +02:00
Nikita Galaiko
bbeadd0c8d fix: improve parsing of ownership ranges in FileOwnership struct
The parsing logic for ownership ranges in the `FileOwnership` struct has been improved. Previously, it split the input string by ':' and then by ',' to extract the file path and ranges. However, this approach had issues with file paths containing ':' characters. 

The updated logic now iterates over the parts of the input string in reverse order. If a part can be parsed as a `Hunk` (range), it is added to the `ranges` vector. Otherwise, it is considered as part of the file path and added to the `file_path_parts` vector. Finally, the `file_path_parts` vector is joined with ':' to form the file path.

This change ensures that file paths containing ':' characters are correctly parsed, allowing for more flexible and accurate parsing of ownership ranges.
2023-09-26 14:18:40 +02:00
Nikita Galaiko
c7a86f2039 unapply ownership api 2023-09-26 13:59:02 +02:00
Nikita Galaiko
3cdce00170 refactor: simplify checkout options in merge and apply branch functions
The merge_virtual_branch_upstream, apply_branch, and update_base_branch functions had repetitive code for checking out conflicts. This commit refactors the code to use a new CheckoutIndexBuilder struct, which simplifies the checkout options and makes the code more readable.
2023-09-26 10:52:46 +02:00
Nikita Galaiko
9f721e57d9 refactor: simplify code for checking out tree and add builder pattern for checkout options
The code for checking out a tree has been simplified by removing unnecessary code and using the builder pattern for checkout options. This makes the code more readable and maintainable.
2023-09-26 10:43:13 +02:00
Nikita Galaiko
18371227e8 refactor: simplify code for adding index entry and building working directory tree 2023-09-26 10:30:16 +02:00
Nikita Galaiko
065c00b011 reduce amount of opened file for locks 2023-09-25 10:36:51 +02:00
Scott Chacon
43beb0f5d5
fix: update merge_virtual_branch_upstream function to accept optional keys_controller parameter 2023-09-21 10:05:23 +02:00
Scott Chacon
3130d5fd1a merged upstream 2023-09-21 09:32:34 +02:00
Scott Chacon
c81b4e363f
merge test 2023-09-21 09:32:27 +02:00
Nikita Galaiko
34274bb3de explicitly define git url 2023-09-20 15:56:48 +02:00
Scott Chacon
aff8f261e2
add tests, remove other branches before merging, checkout conflict state 2023-09-20 15:25:12 +02:00
Nikita Galaiko
5c98330cc0 remove old commit page 2023-09-20 12:33:03 +02:00
Nikita Galaiko
c97b638f2f small fixes 2023-09-20 12:15:05 +02:00
Nikita Galaiko
1b520ca44d test 2023-09-20 11:56:16 +02:00
Nikita Galaiko
5f4b7acfc1 refactor: git commit signing 2023-09-20 11:53:59 +02:00
Scott Chacon
b2833e2549 feat: add merge_virtual_branch_upstream function to merge upstream changes into branch
The merge_virtual_branch_upstream function is added to merge the changes from the upstream branch into the current branch. This function checks if the project is in a conflicted state and if not, it proceeds with the merge. It finds the merge base between the upstream commit and the current branch's head commit, and then tries to merge the working directory tree with the remote tree. If the merge is successful, it commits the merge tree and updates the branch data.
2023-09-20 10:23:32 +02:00
Scott Chacon
d833643abf fix up stuff, remove debug, add test assert 2023-09-19 15:55:32 +02:00
Scott Chacon
c3adce8238 Merge remote-tracking branch 'origin/master' into sc-signing-2 2023-09-19 15:45:05 +02:00
Scott Chacon
e60c5e58d2 signing try number 2 2023-09-19 15:13:06 +02:00
Nikita Galaiko
60b4c63078 feat: refactor virtual branch module structure and add materialized view structs for presentation purposes
The virtual branch module structure has been refactored to improve code organization and readability. The module now consists of separate files for virtual branch, remote, and files related functionality.

Additionally, materialized view structs have been added for presentation purposes. These structs include `VirtualBranch`, `VirtualBranchCommit`, `VirtualBranchFile`, and `VirtualBranchHunk`. These structs provide a materialized view of the virtual branch data and are used for presentation purposes through the IPC.

This refactoring improves code maintainability and provides a clearer separation of concerns between the virtual branch module and the presentation layer.
2023-09-19 13:02:51 +02:00
Nikita Galaiko
160eae4e22 fix function call 2023-09-18 15:11:20 +02:00
Nikita Galaiko
7ca7dfd3e2 cargo fmt 2023-09-18 15:05:57 +02:00
Nikita Galaiko
e98f8bbf7b merged upstream 2023-09-18 15:04:15 +02:00
Nikita Galaiko
0caf0366e3 commit files fetching async 2023-09-18 15:04:09 +02:00
Nikita Galaiko
49d5295911 no error is branch is already applied 2023-09-18 13:59:50 +02:00
Nikita Galaiko
f5a525d840 make isMergeable asyncronous 2023-09-18 10:39:48 +02:00