X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=rc%2Fgit;h=90d1c215a2e46ae48cb468af90a32cde5add29d6;hb=7ddf095f187ca60d9a70fb83b2bc3c2b6d91f088;hp=c6253a2b52917000a7aed9d9e1de9c96ec5d8744;hpb=b51c35a31f4a36c2561994293571e2df68afaf51;p=clearscm.git diff --git a/rc/git b/rc/git index c6253a2..90d1c21 100644 --- a/rc/git +++ b/rc/git @@ -30,12 +30,22 @@ function in_git_repo { function git () { # Need to reset title since we put the branch name in the titlebar - git=$(which git) + git=$(/usr/bin/which git) - if [ "$1" = "checkout" -o "$1" = "co" ]; then - $git $@ - set_title - else - $git $@ + if [ "${git:0:3}" != "no " ]; then + if [ "$1" = "checkout" -o "$1" = "co" ]; then + $git "$@" + set_title + elif [ "$1" = "files" ]; then + if [ -z "$2" ]; then + echo "Files in git commit HEAD" + $git show --pretty="" --name-only HEAD + else + echo "Files in git commit $2" + $git show --pretty="" --name-only $2 + fi + else + $git "$@" + fi fi } # git