File tree 1 file changed +7
-6
lines changed 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -391,20 +391,21 @@ k () {
391
391
# then mark appropriately
392
392
if (( INSIDE_WORK_TREE == 0 )) ; then
393
393
if (( IS_DIRECTORY )) ; then
394
- if command git --git-dir=" $GIT_TOPLEVEL /.git" --work-tree=" ${NAME} " diff --quiet --ignore-submodules HEAD & > /dev/null # if dirty
394
+ if command git --git-dir=" $GIT_TOPLEVEL /.git" --work-tree=" ${NAME} " diff --stat -- quiet --ignore-submodules HEAD & > /dev/null # if dirty
395
395
then REPOMARKER=$' \e [38;5;46m|\e [0m' # Show a green vertical bar for clean
396
396
else REPOMARKER=$' \e [0;31m+\e [0m' # Show a red vertical bar if dirty
397
397
fi
398
398
fi
399
399
else
400
400
if (( IS_DIRECTORY )) ; then
401
- # If the directory is ignored, skip it
402
- if command git check-ignore --quiet ${NAME} 2> /dev/null
403
- then STATUS=' !! '
404
- else STATUS=$( command git --git-dir= $GIT_TOPLEVEL /.git --work-tree= $GIT_TOPLEVEL status --porcelain --untracked-files=normal ${ ${ ${NAME : a} ## $GIT_TOPLEVEL } #*/ } )
401
+ # If the directory isn't ignored or clean, we'll just say it's dirty
402
+ if command git check-ignore --quiet ${NAME} 2> /dev/null; then STATUS= ' !! '
403
+ elif command git diff --stat --quiet --ignore-submodules ${NAME} 2> /dev/null ; then STATUS=' ' ;
404
+ else STATUS=' M '
405
405
fi
406
406
else
407
- STATUS=$( command git status --porcelain --ignored --untracked-files=normal $NAME )
407
+ # File
408
+ STATUS=$( command git status --porcelain --ignored --untracked-files=normal $GIT_TOPLEVEL /${${${NAME: a} ## $GIT_TOPLEVEL } #*/ } )
408
409
fi
409
410
STATUS=${STATUS[1,2]}
410
411
if [[ $STATUS == ' M' ]]; then REPOMARKER=$' \e [0;31m+\e [0m' ; # Tracked & Dirty
You can’t perform that action at this time.
0 commit comments