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

Replace deprecated operators in panache-git #321

Merged
merged 1 commit into from
Dec 4, 2022
Merged
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
Replace deprecated operators in panache-git
  • Loading branch information
ehdevries committed Dec 4, 2022
commit 0d56fa5325021cfbc55c7351872313d954f52e17
34 changes: 17 additions & 17 deletions prompt/panache-git.nu
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export def repo-structured [] {

let has_staging_or_worktree_changes = (if $in_git_repo {
$status
| where ($it | str starts-with '1') || ($it | str starts-with '2')
| where ($it | str starts-with '1') or ($it | str starts-with '2')
| str join
| is-empty
| nope
Expand Down Expand Up @@ -161,7 +161,7 @@ export def repo-structured [] {

let staging_worktree_table = (if $has_staging_or_worktree_changes {
$status
| where ($it | str starts-with '1') || ($it | str starts-with '2')
| where ($it | str starts-with '1') or ($it | str starts-with '2')
| split column ' '
| get column2
| split column '' staging worktree --collapse-empty
Expand Down Expand Up @@ -251,31 +251,31 @@ export def repo-styled [] {
let is_local_only = ($status.tracking_upstream_branch != true)

let upstream_deleted = (
$status.tracking_upstream_branch &&
$status.tracking_upstream_branch and
$status.upstream_exists_on_remote != true
)

let is_up_to_date = (
$status.upstream_exists_on_remote &&
$status.commits_ahead == 0 &&
$status.upstream_exists_on_remote and
$status.commits_ahead == 0 and
$status.commits_behind == 0
)

let is_ahead = (
$status.upstream_exists_on_remote &&
$status.commits_ahead > 0 &&
$status.upstream_exists_on_remote and
$status.commits_ahead > 0 and
$status.commits_behind == 0
)

let is_behind = (
$status.upstream_exists_on_remote &&
$status.commits_ahead == 0 &&
$status.upstream_exists_on_remote and
$status.commits_ahead == 0 and
$status.commits_behind > 0
)

let is_ahead_and_behind = (
$status.upstream_exists_on_remote &&
$status.commits_ahead > 0 &&
$status.upstream_exists_on_remote and
$status.commits_ahead > 0 and
$status.commits_behind > 0
)

Expand Down Expand Up @@ -310,15 +310,15 @@ export def repo-styled [] {
})

let has_staging_changes = (
$status.staging_added_count > 0 ||
$status.staging_modified_count > 0 ||
$status.staging_added_count > 0 or
$status.staging_modified_count > 0 or
$status.staging_deleted_count > 0
)

let has_worktree_changes = (
$status.untracked_count > 0 ||
$status.worktree_modified_count > 0 ||
$status.worktree_deleted_count > 0 ||
$status.untracked_count > 0 or
$status.worktree_modified_count > 0 or
$status.worktree_deleted_count > 0 or
$status.merge_conflict_count > 0
)

Expand All @@ -342,7 +342,7 @@ export def repo-styled [] {
''
})

let delimiter = (if ($has_staging_changes && $has_worktree_changes) {
let delimiter = (if ($has_staging_changes and $has_worktree_changes) {
('|' | bright-yellow)
} else {
''
Expand Down