refactor: avoid pushd/popd to enable commands to pass from root-enabled directories
This commit is contained in:
1 parent
d58fe853d6
commit
cca507da6a
1 file changed
+5
-7
@@ -221,16 +221,14 @@ fn-git-fetch() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd "$DOKKU_ROOT/$APP" > /dev/null
|
git -C "$APP_ROOT" remote rm remote > /dev/null 2>&1 || true
|
||||||
git remote rm remote > /dev/null 2>&1 || true
|
git -C "$APP_ROOT" remote add --mirror=fetch --no-tags remote "$GIT_REMOTE"
|
||||||
git remote add --mirror=fetch --no-tags remote "$GIT_REMOTE"
|
|
||||||
if [[ -z "$GIT_REF" ]]; then
|
if [[ -z "$GIT_REF" ]]; then
|
||||||
git fetch --update-head-ok remote "$DOKKU_DEPLOY_BRANCH"
|
git -C "$APP_ROOT" fetch --update-head-ok remote "$DOKKU_DEPLOY_BRANCH"
|
||||||
else
|
else
|
||||||
git fetch --update-head-ok remote
|
git -C "$APP_ROOT" fetch --update-head-ok remote
|
||||||
git update-ref "refs/heads/$DOKKU_DEPLOY_BRANCH" "$GIT_REF"
|
git -C "$APP_ROOT" update-ref "refs/heads/$DOKKU_DEPLOY_BRANCH" "$GIT_REF"
|
||||||
fi
|
fi
|
||||||
popd > /dev/null
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn-git-last-updated-at() {
|
fn-git-last-updated-at() {
|
||||||
|
|||||||
Reference in new issue
Block a user