mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-27 20:25:12 +00:00
fix git command in lint.fish script
This commit is contained in:
parent
d2ae00ca44
commit
784b438d4a
1 changed files with 2 additions and 2 deletions
|
@ -35,14 +35,14 @@ else
|
||||||
# We haven't been asked to lint all the source. If there are uncommitted
|
# We haven't been asked to lint all the source. If there are uncommitted
|
||||||
# changes lint those, else lint the files in the most recent commit.
|
# changes lint those, else lint the files in the most recent commit.
|
||||||
set pending (git status --porcelain --short --untracked-files=all | sed -e 's/^ *//')
|
set pending (git status --porcelain --short --untracked-files=all | sed -e 's/^ *//')
|
||||||
if count $pending > /dev/null
|
if set -q pending[1]
|
||||||
# There are pending changes so lint those files.
|
# There are pending changes so lint those files.
|
||||||
for arg in $pending
|
for arg in $pending
|
||||||
set files $files (string split -m 1 ' ' $arg)[2]
|
set files $files (string split -m 1 ' ' $arg)[2]
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
# No pending changes so lint the files in the most recent commit.
|
# No pending changes so lint the files in the most recent commit.
|
||||||
set files (git show --porcelain --name-only --pretty=oneline head | tail --lines=+2)
|
set files (git show --word-diff=porcelain --name-only --pretty=oneline head)[2..-1]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Extract just the C/C++ files.
|
# Extract just the C/C++ files.
|
||||||
|
|
Loading…
Reference in a new issue