summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2022-08-18 14:22:51 +0800
committerGitHub <noreply@github.com>2022-08-18 07:22:51 +0100
commitf52ae552d3ef2c0c0c6de6429cee7b8271f14671 (patch)
treedeff9483deda5fdd8cb7ab7118a6dcb89e7b9dbe /src
parent12d72de0a60ee23c5b0995786d1edeb6007b5a55 (diff)
fix(git): upgrade `gitoxide` to v0.21 (#4277)
* upgrade `gitoxide` to v0.21 This release comes with lenient configuration handling by default, allowing to open repositories even their configuration values are invalid (even for git), as long as there are viable defaults. Furthermore this release adds the ability to open submodule repsitories. Fixes https://github.com/starship/starship/issues/4266 and fixes https://github.com/starship/starship/issues/4272 * Assure an object cache is set to speed up `commit.describe()` Related to https://github.com/starship/starship/issues/4275 bringing performance to spitting distance compared to git.
Diffstat (limited to 'src')
-rw-r--r--src/modules/git_commit.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/modules/git_commit.rs b/src/modules/git_commit.rs
index bc2fba510..88ab069aa 100644
--- a/src/modules/git_commit.rs
+++ b/src/modules/git_commit.rs
@@ -51,7 +51,9 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
}
fn git_tag(repo: &Repo) -> Option<String> {
- let git_repo = repo.open();
+ // allow environment variables like GITOXIDE_OBJECT_CACHE_MEMORY and GITOXIDE_DISABLE_PACK_CACHE to speed up operation for some repos
+ let mut git_repo = repo.open().apply_environment();
+ git_repo.object_cache_size_if_unset(4 * 1024 * 1024);
let head_commit = git_repo.head_commit().ok()?;
let describe_platform = head_commit.describe().names(AnnotatedTags);