From bfeb897a6dfda09a177f3013bbd3ba191b3ec5e7 Mon Sep 17 00:00:00 2001 From: jykntr Date: Wed, 18 Feb 2015 17:09:39 -0700 Subject: [PATCH] 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. --- bin/git-summary | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/git-summary b/bin/git-summary index 3017edc..c1bcdce 100755 --- a/bin/git-summary +++ b/bin/git-summary @@ -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##*/}