Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove deprecated --switch: bool #154

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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<name: string, hash: string, type: string> {
let tag = do -i {
^git describe HEAD --tags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"}),
Expand Down
2 changes: 1 addition & 1 deletion pkgs/nu-git-manager-sugar/tests/git.nu
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down