From 19465cd61c887cafd89c26099f617eb1fc2b3ff7 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Mon, 13 Sep 2010 14:21:17 -0500 Subject: [PATCH] simplify git-info --- git-info | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/git-info b/git-info index e9c3637..512d641 100755 --- a/git-info +++ b/git-info @@ -1,18 +1,13 @@ #! /bin/sh # based on a script by Duane Johnson with some simplifications -CDPATH=`git rev-parse --show-cdup` +GIT_DIR=`git rev-parse --git-dir` # not a valid git repo? leave if [ $? -ne 0 ] ; then exit fi -# switch to the directory holding .git -if [ -n "${CDPATH}" ] ; then - cd "${CDPATH}" -fi - # Show various information about this git directory echo "== Remote URL: `git remote -v`" @@ -25,7 +20,7 @@ git branch echo echo "== Configuration (.git/config)" -cat .git/config +cat "${GIT_DIR}/config" echo echo "== Most Recent Commit"