lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 030f1c5 1/7: Fix incorrect command order


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 030f1c5 1/7: Fix incorrect command order
Date: Thu, 16 Nov 2017 11:09:54 -0500 (EST)

branch: master
commit 030f1c5b9f1d77b7f45e900b8486b8bfa121b7a9
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix incorrect command order
    
    Moved the 'cd' command to the top. Changing to the directory where the
    script resides wasn't a precondition for 'git config --global ...', but
    it became a precondition when '--global' was removed, so invoking the
    script from a different working directory did the wrong thing.
---
 check_git_setup.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/check_git_setup.sh b/check_git_setup.sh
index 7335fc3..723f929 100755
--- a/check_git_setup.sh
+++ b/check_git_setup.sh
@@ -21,6 +21,11 @@
 # email: <address@hidden>
 # snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
 
+# Do this in the directory where this script resides, which is
+# deliberately the "toplevel" directory.
+
+cd $(dirname $(readlink --canonicalize $0))
+
 # For msw (cygwin) only, make sure 'core.filemode' is "false". See:
 #   https://lists.nongnu.org/archive/html/lmi/2017-11/msg00018.html
 
@@ -37,10 +42,6 @@ esac
 printf "core.filemode is '%s'\n" $(git config --get-all core.filemode)
 
 # Make sure the hooks in the repository's hooks/ directory are used.
-# Do this in the directory where this script resides, which is
-# deliberately the "toplevel" directory.
-
-cd $(dirname $(readlink --canonicalize $0))
 
 case "$(readlink -f .git/hooks)" in
   ("$(pwd)/.git/hooks")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]