Remove deprecated --redirect-stdout in git branch cleanup (#827)

This commit is contained in:
Róbert Kalmár 2024-04-29 13:22:31 +02:00 committed by GitHub
parent 5782e2b5d2
commit 76ab5b09b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,7 +56,7 @@ export def "git branch-cleanup" [
# The current branch name
def current_branch [] {
run-external --redirect-stdout "git" "branch" "--show-current"
run-external "git" "branch" "--show-current"
| into string
| str trim
}
@ -85,14 +85,14 @@ def get_default_branch [
$upstream
]
run-external --redirect-stdout "git" "symbolic-ref" ...$args
run-external "git" "symbolic-ref" ...$args
| str trim
| path basename
}
# Get the local set of branches to always keep
def get_keep [] {
let keep = run-external --redirect-stdout "git" "config" "--local" "--get" "branch-cleanup.keep"
let keep = run-external "git" "config" "--local" "--get" "branch-cleanup.keep"
if ( $keep | is-empty ) {
return []
@ -139,7 +139,7 @@ def list_merged [
]
)
run-external --redirect-stdout "git" "branch" ...$args
run-external "git" "branch" ...$args
| lines
| filter {|branch|
$keep
@ -150,7 +150,7 @@ def list_merged [
}
def remotes [] {
run-external --redirect-stdout "git" "remote" "-v"
run-external "git" "remote" "-v"
| parse "{value}\t{description} ({operation})"
| select value description
| uniq