File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -391,20 +391,21 @@ k () {
391391 # then mark appropriately
392392 if (( INSIDE_WORK_TREE == 0 )) ; then
393393 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
395395 then REPOMARKER=$' \e [38;5;46m|\e [0m' # Show a green vertical bar for clean
396396 else REPOMARKER=$' \e [0;31m+\e [0m' # Show a red vertical bar if dirty
397397 fi
398398 fi
399399 else
400400 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 '
405405 fi
406406 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 } #*/ } )
408409 fi
409410 STATUS=${STATUS[1,2]}
410411 if [[ $STATUS == ' M' ]]; then REPOMARKER=$' \e [0;31m+\e [0m' ; # Tracked & Dirty
You can’t perform that action at this time.
0 commit comments