From da14e94c9988dd03ab61b1cd5b22ff29895172e0 Mon Sep 17 00:00:00 2001 From: amtoine Date: Sat, 23 Dec 2023 10:59:07 +0100 Subject: [PATCH] remove `--switch: bool` --- pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/git.nu | 2 +- .../nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu | 2 +- pkgs/nu-git-manager-sugar/tests/git.nu | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/git.nu b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/git.nu index d5ddf8a..af3bcce 100644 --- a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/git.nu +++ b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/git.nu @@ -40,7 +40,7 @@ use style.nu [color] # │ type │ detached │ # ╰──────┴──────────╯ export def get-revision [ - --short-hash: bool # print the hash of a detached HEAD in short format + --short-hash # print the hash of a detached HEAD in short format ]: nothing -> record { let tag = do -i { ^git describe HEAD --tags diff --git a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu index 6fa21fd..181d4b0 100644 --- a/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu +++ b/pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/lib/prompt.nu @@ -31,7 +31,7 @@ export def get-left-prompt [duration_threshold: duration]: nothing -> string { } let git_branch_segment = if $is_git_repo { - let revision = get-revision --short-hash true + let revision = get-revision --short-hash let pretty_branch_tokens = match $revision.type { "branch" => [ ($revision.name | color {fg: "yellow", attr: "ub"}), diff --git a/pkgs/nu-git-manager-sugar/tests/git.nu b/pkgs/nu-git-manager-sugar/tests/git.nu index 051228c..bc341be 100644 --- a/pkgs/nu-git-manager-sugar/tests/git.nu +++ b/pkgs/nu-git-manager-sugar/tests/git.nu @@ -365,7 +365,7 @@ export module prompt { ] def "assert revision" [expected: record] { - let actual = get-revision --short-hash true + let actual = get-revision --short-hash assert equal $actual $expected }