mirror of
https://github.com/Stunkymonkey/dotfiles.git
synced 2025-09-13 22:12:04 +02:00
Enforce git commands being run inside git folder
This commit is contained in:
parent
72ceb16f5f
commit
ad24ebe4a2
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Enforce being in a git repository
|
||||||
|
git rev-parse --is-inside-work-tree >/dev/null || exit $?
|
||||||
|
|
||||||
# save as i.e.: git-authors and set the executable flag
|
# save as i.e.: git-authors and set the executable flag
|
||||||
git ls-tree -r -z --name-only HEAD -- "${1}" \
|
git ls-tree -r -z --name-only HEAD -- "${1}" \
|
||||||
| xargs -0 -n1 git blame --line-porcelain HEAD \
|
| xargs -0 -n1 git blame --line-porcelain HEAD \
|
||||||
|
@ -7,4 +10,3 @@ git ls-tree -r -z --name-only HEAD -- "${1}" \
|
||||||
| sort \
|
| sort \
|
||||||
| uniq -c \
|
| uniq -c \
|
||||||
| sort -nr
|
| sort -nr
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue