Skip to content

Commit

Permalink
gi: only show forced pushes if local is behind
Browse files Browse the repository at this point in the history
  • Loading branch information
XPhyro committed Mar 1, 2024
1 parent a3f85f3 commit 45eb8bf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/sh/util/integration/git/gi
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,14 @@ git_commit() {

git_push() {
selection="$(
printf "%s\n" \
"Normal" \
"Force With Lease" \
"Force" \
| fzf --multi --preview="unbuffer git status"
{
printf "%s\n" \
"Normal"
git status -sb | head -n 1 | grep -Eq '\[.*behind [0-9]+.*\]$' \
&& printf "%s\n" \
"Force With Lease" \
"Force"
} | fzf --multi --preview="unbuffer git status"
)"

case "$selection" in
Expand Down

0 comments on commit 45eb8bf

Please sign in to comment.