Using rev-parse git option is safer than manually parsing git files. Signed-off-by: Andrzej Hajda <a.hajda@xxxxxxxxxxx> --- dim | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dim b/dim index e4a4afe..e999409 100755 --- a/dim +++ b/dim @@ -556,13 +556,7 @@ function check_conflicts # tree function git_dir { - local dir=${1:-$PWD} - - if [ -d $dir/.git ] ; then - echo $dir/.git - else - cut -d ' ' -f 2 < $dir/.git - fi + git -C ${1:-$PWD} rev-parse --absolute-git-dir } function pull_rerere_cache -- 2.17.1 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel