]> git.phdru.name Git - git-scripts.git/commitdiff
Fix: Run chmod only after clone
authorOleg Broytman <phd@phdru.name>
Fri, 2 Mar 2018 07:53:32 +0000 (10:53 +0300)
committerOleg Broytman <phd@phdru.name>
Fri, 2 Mar 2018 07:53:32 +0000 (10:53 +0300)
clone
fork

diff --git a/clone b/clone
index 94932f216c27317c0dde51aa3deaea0d4b32fe82..7ca3a0b6150ec23fc515688b3c4445525a87c745 100755 (executable)
--- a/clone
+++ b/clone
@@ -16,12 +16,11 @@ if [ -d .git ]; then
    git remote set-url origin "$origin"
 else
    git clone -o origin "$origin" "$local_repo" &&
-   cd "$local_repo"
+   cd "$local_repo" &&
+   chmod a-x .git/config
 fi &&
 
 pwd >> "`dirname \"$0\"`"/locate-all.list &&
-
-chmod a-x .git/config &&
 branch="`git rev-parse --abbrev-ref HEAD`"
 
 git config push.default current &&
diff --git a/fork b/fork
index 7782b8977b71eef17f2e8816f003f7b134b6da74..09248da1bf3087dfa66a3d200bf72624aa35f402 100755 (executable)
--- a/fork
+++ b/fork
@@ -19,12 +19,12 @@ if [ -d .git ]; then
 else
    git clone -o upstream "$upstream" "$local_repo" &&
    cd "$local_repo" &&
-   pwd >> "`dirname \"$0\"`"/locate-all.list &&
+   chmod a-x .git/config &&
    git remote add origin "$origin"
 fi &&
 
-chmod a-x .git/config &&
-branch="`git rev-parse --abbrev-ref HEAD`"
+pwd >> "`dirname \"$0\"`"/locate-all.list &&
+branch="`git rev-parse --abbrev-ref HEAD`" &&
 
 git pull upstream $branch &&
 git pull origin $branch &&