chiark / gitweb /
tools: make various scripts find the top-levle git dir automatically
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Jun 2018 13:07:14 +0000 (15:07 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
tools/find-double-newline.sh

index 6e7e4cb6996259e4c65a031cbed14e5e5e0e56e3..6a6790b4b2ab1eda8e53f47f450fbd711f959687 100644 (file)
@@ -1,11 +1,13 @@
 #!/bin/sh
 # SPDX-License-Identifier: LGPL-2.1+
 
+TOP=`git rev-parse --show-toplevel`
+
 case "$1" in
 
         recdiff)
                 if [ "$2" = "" ] ; then
-                        DIR="$PWD/.."
+                        DIR="$TOP"
                 else
                         DIR="$2"
                 fi
@@ -15,7 +17,7 @@ case "$1" in
 
         recpatch)
                 if [ "$2" = "" ] ; then
-                        DIR="$PWD/.."
+                        DIR="$TOP"
                 else
                         DIR="$2"
                 fi