Skip to content

Commit

Permalink
Fixes for fish test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
jdelStrother committed Jan 2, 2022
1 parent 25c6724 commit 6dad316
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
16 changes: 3 additions & 13 deletions commands/inits/data/git_wrapper.fish
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
# Based on https://github.com/arbelt/fish-plugin-scmpuff,
# with scmpuff-exec support (https://github.com/mroth/scmpuff/pull/49)
set -x SCMPUFF_GIT_CMD (which git)

if type -q hub
set -x SCMPUFF_GIT_CMD "hub"
end


if not type -q scmpuff
exit 1
end

functions -e git

function git
type -q $SCMPUFF_GIT_CMD; or set -x SCMPUFF_GIT_CMD (which git)
set -q SCMPUFF_GIT_CMD; or set -x SCMPUFF_GIT_CMD (which git)

function git
if test (count $argv) -eq 0
eval $SCMPUFF_GIT_CMD
set -l s $status
Expand All @@ -25,7 +15,7 @@ function git
switch $argv[1]
case commit blame log rebase merge
scmpuff exec -- "$SCMPUFF_GIT_CMD" $argv
case checkout diff rm reset
case checkout diff rm reset restore
scmpuff exec --relative -- "$SCMPUFF_GIT_CMD" $argv
case add
scmpuff exec -- "$SCMPUFF_GIT_CMD" $argv
Expand Down
7 changes: 3 additions & 4 deletions commands/inits/data/status_shortcuts.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
function scmpuff_status
scmpuff_clear_vars
set -lx scmpuff_env_char "e"
set -l cmd_output (/usr/bin/env scmpuff status --filelist $argv ^/dev/null)
set -l cmd_output (/usr/bin/env scmpuff status --filelist $argv)
set -l es "$status"

if test $es -ne 0
git status
return $status
return $es
end

set -l files (string split \t $cmd_output[1])
Expand All @@ -25,7 +24,7 @@ end

function scmpuff_clear_vars
set -l scmpuff_env_char "e"
set -l scmpuff_env_vars (set -x | awk '{print $1}' | grep -E '^'$scmpuff_env_char'\d+')
set -l scmpuff_env_vars (set -x | awk '{print $1}' | grep -E '^'$scmpuff_env_char'[0-9]+')

for v in $scmpuff_env_vars
set -e $v
Expand Down

0 comments on commit 6dad316

Please sign in to comment.