1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-16 02:40:08 +00:00

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.
This commit is contained in:
rogarb 2023-05-22 10:49:10 +00:00 committed by GitHub
parent b06663df23
commit 444e715766
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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