updated git.sh

pull/2/head
Hari Sekhon 4 years ago
parent 2f5548b5a5
commit 75cf44f853

@ -527,13 +527,12 @@ gitu(){
# go to the highest directory level to git diff inside the git repo boundary, otherwise git diff will return nothing
basedir="$(basedir "$filename")" || return 1
pushd "$basedir" >/dev/null || return 1
# XXX: this is returning the full name not the basename
changed_files="$(git status --porcelain "${filename##*/}" |
# XXX: needs -s to return the basename and not the full name
changed_files="$(git status --porcelain -s "${filename##*/}" |
grep -e '^M' -e '^.M' |
sed 's/^...//')"
# while read line would auto-accepting the readline and commit without prompt :-/
for changed_file in $changed_files; do
basename="${changed_file##*/}"
for basename in $changed_files; do
diff="$(git diff --color=always -- "$basename"; git diff --cached --color=always -- "$basename")"
if [ -z "$diff" ]; then
continue

Loading…
Cancel
Save