[igt-dev] [PATCH 1/3] dim: pass git directory via parameter in dim cite, don't cd

Jani Nikula jani.nikula at intel.com
Mon Jan 14 11:41:03 UTC 2019


Make dim_cite safer to use within dim.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 dim | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dim b/dim
index b2fddff1010c..9aac817be567 100755
--- a/dim
+++ b/dim
@@ -2275,9 +2275,8 @@ function dim_cite
 
 	sha1=${1:?$usage}
 
-	cd $DIM_PREFIX/$DIM_REPO
-
-	git log -1 $sha1 "--pretty=format:%H (\"%s\")%n" | \
+	git --git-dir="$DIM_PREFIX/$DIM_REPO/.git" log -1 $sha1 \
+	    "--pretty=format:%H (\"%s\")%n" | \
 		sed -e 's/\([0-f]\{12\}\)[0-f]*/\1/'
 }
 
-- 
2.20.1



More information about the igt-dev mailing list