Skip to content

Commit

Permalink
collect the output of git rev-parse (#109)
Browse files Browse the repository at this point in the history
from the single commit
> this is because `git rev-parse` streams thus, because it returns a
single line, Nushell needs to _collect_ the stream of raw input into a
single `string`.
this can be done with `lines | get 0`, `str trim` or by wrapping the
command in a subexpression.
  • Loading branch information
amtoine committed Nov 24, 2023
1 parent 803915f commit 8ebdc1b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/nu-git-manager-sugar/git.nu
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ use std log
export def "gm repo get commit" [
revision: string = "HEAD" # the revision to get the hash of
]: nothing -> string {
# FIXME: this `str trim` sounds like a bug :thinking:
^git rev-parse $revision | str trim
(^git rev-parse $revision)
}

def repo-root [] {
Expand Down

0 comments on commit 8ebdc1b

Please sign in to comment.