Skip to content

Commit

Permalink
Adjust gp to reduce one _git_status call
Browse files Browse the repository at this point in the history
  • Loading branch information
nashvi committed Mar 19, 2024
1 parent 43b574a commit a8f8074
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/git/git-v2.nu
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ export def gp [
} else {
let m = if $merge { [] } else { [--rebase] }
let a = if $autostash {[--autostash]} else {[]}
let branch = if ($branch | is-empty) { (_git_status).branch } else { $branch }
let prev = (_git_status).branch
let branch = if ($branch | is-empty) { $prev } else { $branch }
let branch_repr = $'(ansi yellow)($branch)(ansi light_gray)'
let lbs = git branch | lines | each { $in | str substring 2..}
let rbs = (remote_branches)
let prev = (_git_status).branch
if $"($remote)/($branch)" in $rbs {
if $branch in $lbs {
let bmsg = $'both local and remote have ($branch_repr) branch'
Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes/kubernetes.nu
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ export-env {
listeners: {
_: [spec listeners]
name: [name]
hostname: [hostname]
port: [port]
protocol: [protocol]
tls: [tls]
Expand Down

0 comments on commit a8f8074

Please sign in to comment.