git-summary correctly displays project name

git-summary correctly displays project name when not executed in the top
level directory of a repository.  Fixes tj/git-extras#302.

Uses the git-sh-setup script to find top level directory and then uses
that directory name for the project name.
This commit is contained in:
jykntr 2015-02-18 17:09:39 -07:00
parent a618a56754
commit bfeb897a6d

View file

@ -1,5 +1,9 @@
#!/usr/bin/env bash
SUBDIRECTORY_OK=Yes
source "$(git --exec-path)/git-sh-setup"
cd_to_toplevel
commit=""
test $# -ne 0 && commit=$@
project=${PWD##*/}