Commit Graph

121 Commits

Author SHA1 Message Date
Nikita Galaiko
116953fbf1 merged upstream 2023-10-11 08:38:46 +02:00
Kiril Videlov
79f473e807 🔨 chore: move github module to correct location in module list 2023-10-10 19:18:44 +02:00
Kiril Videlov
698fb012e8 support for github device oauth flow 2023-10-10 19:18:44 +02:00
Nikita Galaiko
738d1bfceb add a test button 2023-10-10 14:52:16 +02:00
Nikita Galaiko
1857e991aa expose reset virtual branch command 2023-10-10 14:20:49 +02:00
Nikita Galaiko
8ebd529d55 feat: add support for tracking upstream head commit in virtual branches
The changes in this commit add support for tracking the upstream head commit in virtual branches. This is done by introducing a new field `upstream_head` in the `Branch` struct. The `upstream_head` field represents the last commit that has been pushed to the upstream branch.

The following changes were made:
- Added `upstream_head` field to the `Branch` struct
- Updated the `create_virtual_branch` function to initialize the `upstream_head` field as `None`
- Updated the `push` function to set the `upstream_head` field to the current head commit of the virtual branch
- Updated the `create_virtual_branch_from_branch` function to initialize the `upstream_head` field as `None`
- Updated the `BranchWriter` struct to write the `upstream_head` field to the branch metadata
- Updated the `TryFrom<&dyn crate::reader::Reader>` implementation
2023-10-10 14:13:21 +02:00
Nikita Galaiko
1721e9046f feat: reset virtual branch 2023-10-10 14:10:24 +02:00
extrawurst
d3b356c3a9 cleanup clippy warning 2023-10-10 12:42:15 +02:00
Nikita Galaiko
00543d15ee introduce dataDir to git file change handler 2023-10-10 12:24:14 +02:00
extrawurst
ffda438143
Merge pull request #1316 from gitbutlerapp/Add-gb-flush-command
GB-610: flush session if GB_FLUSH file triggers watcher
2023-10-10 12:21:09 +02:00
extrawurst
f535ba30d5 trigger flush_session if GB_FLUSH file triggers watcher git event
* remove GB_FLUSH after processing it
* add test for flushing and deleting flush file
* add more unittests for cases:
 * no session, file -> no flush, file deleted
 * session, file -> flush, file deleted
 * session, no file -> no flush
2023-10-10 12:03:06 +02:00
Nikita Galaiko
69e9d08501 feat: update set_user function to return the updated user object
The `set_user` function in the client code has been updated to return the updated user object after setting it in the app. This change allows for better handling of the user object and enables further operations on it if needed. The updated function now returns a `Result<User, Error>` instead of `Result<(), Error>`.
2023-10-10 10:31:20 +02:00
Nikita Galaiko
e672fb7fbf define types for local app dir and logs dir 2023-10-10 09:21:47 +02:00
Nikita Galaiko
ea94ff2c1a more custom error types 2023-10-09 12:05:24 +02:00
Nikita Galaiko
0d82e470ba privatise projects storage 2023-10-06 15:56:43 +02:00
Nikita Galaiko
b57ef8f2c9 privatise users storage 2023-10-06 15:41:45 +02:00
Nikita Galaiko
0d10db2c9b privatise keys storage 2023-10-06 15:25:48 +02:00
Nikita Galaiko
295ace965c feat: refactor zip controller to use new zip module
The zip controller has been refactored to use the new zip module. This change includes updating the import statements and modifying the main function to generate the tauri context with the new zip module.

Additionally, the zip controller now has a new struct called Controller, which contains the necessary fields for handling zip operations. The TryFrom trait has been implemented for the Controller struct to allow for easy creation from the AppHandle.

The main changes include:
- Importing the zip module and updating import statements
- Refactoring the main function to generate the tauri context with the new zip module
- Creating a new Controller struct for handling zip operations
- Implementing the TryFrom trait for the Controller struct to allow for easy creation from the AppHandle
2023-10-06 15:08:42 +02:00
Nikita Galaiko
84e2d8533e pass project repository to gb_repository methods 2023-10-06 12:43:32 +02:00
Nikita Galaiko
08d26ae037 refactor: Update error handling in controller module
The changes in this commit refactor the error handling in the controller module. Instead of using a specific error type for storage errors, the code now uses the `anyhow` crate to handle errors more generically. This simplifies the code and allows for better error handling and reporting.
2023-10-06 08:47:59 +02:00
Nikita Galaiko
83b251b2b4 feat: add users controller to handle user-related operations
The users controller has been added to handle user-related operations such as getting, setting, and deleting user information. This controller is responsible for interacting with the storage module to perform these operations.
2023-10-06 08:40:27 +02:00
Nikita Galaiko
09ac7f1c24 delete extra files 2023-10-05 16:03:41 +02:00
Nikita Galaiko
7e500d5671 fix tests 2023-10-05 16:03:01 +02:00
Nikita Galaiko
73d5ebf823 extract projects controller 2023-10-05 15:44:34 +02:00
Nikita Galaiko
53ed4425f6 feat: add mark_active_session function to update session metadata
The mark_active_session function has been added to the Repository struct. This function updates the last_timestamp_ms field of the current session's metadata to the current system time. This is done to keep track of the last time the session was active.

This function is called in several places where the current session is required to be updated, such as when writing to targets, branches, deltas, bookmarks, and handling git file changes. By updating the session metadata, we ensure that the session remains active and up-to-date.

This change improves the accuracy of session tracking and helps in managing active sessions effectively.
2023-10-05 13:05:18 +02:00
Nikita Galaiko
62d2b7c6fa fix: fix visibility of should_flush function and update test cases for should_flush function 2023-10-05 12:28:37 +02:00
Nikita Galaiko
7d245f6f59 chore: update versions of @tauri-apps/cli and related packages to 1.5.1 2023-10-05 10:31:51 +02:00
Nikita Galaiko
37e7507e53 chore: refactor projects_storage methods to use consistent naming and simplify code
The changes in this commit refactor the methods in the `projects_storage` module to use consistent naming and simplify the code. The following changes were made:

- Renamed the `update_project` method to `update` in the `projects_storage` module.
- Renamed the `add_project` method to `add` in the `projects_storage` module.
- Renamed the `get_project` method to `get` in the `projects_storage` module.
- Renamed the `list_projects` method to `list` in the `projects_storage` module.

These changes improve code readability and maintainability by using consistent naming conventions and simplifying the method signatures.
2023-10-05 10:04:36 +02:00
Nikita Galaiko
805a23f1b8 fix: fix async handling in App methods
- The `upsert_bookmark` method was not properly handling the async code. It now properly awaits the necessary async operations.
- The `init_project` method now properly handles async code and awaits the necessary async operations.
- The `init` method now properly handles async code and awaits the necessary async operations.
- The `add_project` method now properly handles async code and awaits the necessary async operations.

This ensures that the async operations are properly executed and awaited, preventing potential race conditions or incorrect behavior.
2023-10-05 09:39:45 +02:00
Nikita Galaiko
1ccc204c75 chore: refactor delete_project and update_project functions to be asynchronous 2023-10-05 09:34:51 +02:00
Nikita Galaiko
223cbfaba2 extracts commands mod 2023-10-05 09:28:45 +02:00
Nikita Galaiko
b3902026be refactor: update error handling and repository opening logic in project_repository module 2023-10-05 09:08:42 +02:00
Nikita Galaiko
b2d84362a6 minor fixes 2023-10-05 08:54:13 +02:00
Nikita Galaiko
b81efe9b72 feat: update project path handling to use path::PathBuf instead of String
The previous implementation used a string to represent the project path, which led to potential issues when manipulating paths. The update changes the project path to use the path::PathBuf type, which provides better path manipulation and error handling capabilities. This change improves the overall reliability and maintainability of the code.
2023-10-05 08:44:56 +02:00
Nikita Galaiko
cfafb76a21 add tests for binary registration 2023-10-05 08:25:43 +02:00
Nikita Galaiko
1df251baca chore: remove unused fileGroup function and related code 2023-10-04 16:44:30 +02:00
Nikita Galaiko
b86259b64c chore: remove unused Statuses component and git_status API endpoint 2023-10-04 16:35:06 +02:00
Nikita Galaiko
bb88219933 remove more leftovers 2023-10-04 16:23:32 +02:00
Nikita Galaiko
df32ebfffa chore: remove unused code related to git activity logging 2023-10-04 16:12:55 +02:00
Nikita Galaiko
65a0979649
Merge pull request #1286 from gitbutlerapp/deps-refactor
Deps refactor
2023-10-04 16:07:35 +02:00
Nikita Galaiko
5ba4a9a6b4 drop gb_project's dependency on project_storage 2023-10-04 15:53:00 +02:00
Scott Chacon
e72ef03bc8
Merge pull request #1284 from gitbutlerapp/update-branch-with-upstream
Change upstream branch name
2023-10-04 15:33:53 +02:00
Scott Chacon
7281ed8fdf
🔥 refactor: remove debug statement for remote branch 2023-10-04 15:27:21 +02:00
Scott Chacon
002a52af57
Merge pull request #1285 from gitbutlerapp/Set-user-only-permissions
Set files in data dir to user only (0o600)
2023-10-04 15:23:09 +02:00
Scott Chacon
f225d0aa7f
🐛 fix: set user-only permissions for private key file in Storage::write_file method 2023-10-04 13:59:50 +02:00
Scott Chacon
ccf6136b9a
feat: add Remote Name panel to display and update remote branch name in UI 2023-10-04 13:16:33 +02:00
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