diff options
author | rogarb <69053978+rogarb@users.noreply.github.com> | 2023-05-22 10:49:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-22 12:49:10 +0200 |
commit | 444e715766c4a8b267dba82f3f0f562584d61adc (patch) | |
tree | e98ceb91a0e8abfdc70c5d4ff4409ed93d02ae37 /themes/bureau.zsh-theme | |
parent | b06663df23b2910a6e542dc114dc7adc2cdce22f (diff) | |
download | zsh-444e715766c4a8b267dba82f3f0f562584d61adc.tar.gz zsh-444e715766c4a8b267dba82f3f0f562584d61adc.tar.bz2 zsh-444e715766c4a8b267dba82f3f0f562584d61adc.zip |
feat(bureau): ignore hidden git repos (#11707)
The git_prompt_info() function in lib/git.zsh ignores git repos which
contains a specific config key, allowing to effectively "hide" them from
the prompt. Unfortunately, the bureau theme doesn't use the library
function to build its prompt.
This commit modifies the specific prompt generation function in the
bureau theme in order to achieve the same behaviour.
Diffstat (limited to 'themes/bureau.zsh-theme')
-rw-r--r-- | themes/bureau.zsh-theme | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/themes/bureau.zsh-theme b/themes/bureau.zsh-theme index 698aa2ff8..9943a0c8c 100644 --- a/themes/bureau.zsh-theme +++ b/themes/bureau.zsh-theme @@ -67,6 +67,12 @@ bureau_git_status() { } bureau_git_prompt() { + # ignore non git folders and hidden repos (adapted from lib/git.zsh) + if ! command git rev-parse --git-dir &> /dev/null \ + || [[ "$(command git config --get oh-my-zsh.hide-info 2>/dev/null)" == 1 ]]; then + return + fi + # check git information local gitinfo=$(bureau_git_info) if [[ -z "$gitinfo" ]]; then |