config: improve some flags
This commit is contained in:
parent
d0b361c748
commit
9d36a94b1a
|
@ -16,7 +16,7 @@ gcn() {
|
|||
root="$(git rev-parse --show-toplevel)"
|
||||
if test "$root" = "$DATA"
|
||||
then
|
||||
if test $# -eq 0 || test -e $1
|
||||
if test $# -eq 0 || test -e "$1"
|
||||
then
|
||||
fulldir="$(realpath ${1:-$PWD})"
|
||||
dir="${fulldir#$root/*/}"
|
||||
|
|
|
@ -9,5 +9,6 @@ while test $# -gt 1; do
|
|||
while ! test -e "$dir"
|
||||
do dir="$(dirname "$dir")"
|
||||
done
|
||||
test $flag "$dir"
|
||||
test -L "$dir" ||
|
||||
test $flag "$dir"
|
||||
done
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
# Stage moved files fitting the already staged ones
|
||||
git diff --name-only --cached >/tmp/staged
|
||||
git add $(git rev-parse --show-toplevel)
|
||||
git status -s | tail +2 | grep -vf /tmp/staged | cut -c4- | sed 's/ -> /\n/' | xargs git restore --staged
|
Loading…
Reference in New Issue