mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-03 06:52:08 +03:00
optimize git2
for good measure, and enable them from tauri
and cli
This commit is contained in:
parent
c58112f157
commit
84b2db9685
@ -9,6 +9,7 @@ mod command;
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let args: Args = clap::Parser::parse();
|
||||
gitbutler_project::configure_git2();
|
||||
|
||||
match args.cmd {
|
||||
args::Subcommands::Branch(vbranch::Platform { cmd }) => {
|
||||
|
@ -7,3 +7,14 @@ mod storage;
|
||||
pub use controller::Controller;
|
||||
pub use project::{ApiProject, AuthKey, CodePushState, FetchResult, Project, ProjectId};
|
||||
pub use storage::UpdateRequest;
|
||||
|
||||
/// A utility to be used from applications to optimize `git2` configuration.
|
||||
/// See comments for details.
|
||||
pub fn configure_git2() {
|
||||
// Do not re-hash each decoded objects for quite a significant performance gain.
|
||||
// This delegates object validation to `git fsck`, which seems fair.
|
||||
git2::opts::strict_hash_verification(false);
|
||||
// Thus far, no broken object was created, and if that would be the case, tests should catch it.
|
||||
// These settings are only changed from `main` of applications.
|
||||
git2::opts::strict_object_creation(false);
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ use tauri::{generate_context, Manager};
|
||||
use tauri_plugin_log::LogTarget;
|
||||
|
||||
fn main() {
|
||||
gitbutler_project::configure_git2();
|
||||
let tauri_context = generate_context!();
|
||||
gitbutler_secret::secret::set_application_namespace(
|
||||
&tauri_context.config().tauri.bundle.identifier,
|
||||
|
Loading…
Reference in New Issue
Block a user