From: Oleg Broytman Date: Fri, 2 Mar 2018 07:53:32 +0000 (+0300) Subject: Fix: Run chmod only after clone X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=b72ec5e939dcc8bed07a82745be4cd9249565831;p=git-scripts.git Fix: Run chmod only after clone --- diff --git a/clone b/clone index 94932f2..7ca3a0b 100755 --- 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 7782b89..09248da 100755 --- 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 &&