X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=rc%2Fgit;h=341ca7bcd4ca99c40037742f555acdf37cc59a27;hb=bdb1e0c845a6921e22d52fbff3404d5c1dfae520;hp=fabea71a4e9cd31fd4ada827dfefaca625911cc8;hpb=14bd6c2ec7fb50112f0c3df8aa66ba568be97bd2;p=clearscm.git diff --git a/rc/git b/rc/git index fabea71..341ca7b 100644 --- a/rc/git +++ b/rc/git @@ -16,7 +16,7 @@ function in_git_repo { pwd=$PWD - while [ "$pwd" != "/" ]; do + while [ "$pwd" != "/" -a "$pwd" != "//" ]; do if [ -d "$pwd/.git" ]; then true; return; @@ -32,10 +32,20 @@ function git () { # Need to reset title since we put the branch name in the titlebar git=$(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