fix: do not allow fetch on fresh apps
This commit is contained in:
1 parent
97750f8b28
commit
f73c927512
1 file changed
+5
@@ -238,6 +238,11 @@ fn-git-clone() {
|
|||||||
fn-git-fetch() {
|
fn-git-fetch() {
|
||||||
declare APP="$1" GIT_REMOTE="$2" GIT_REF="$3"
|
declare APP="$1" GIT_REMOTE="$2" GIT_REF="$3"
|
||||||
local DOKKU_DEPLOY_BRANCH
|
local DOKKU_DEPLOY_BRANCH
|
||||||
|
local APP_ROOT="$DOKKU_ROOT/$APP"
|
||||||
|
|
||||||
|
if [[ "$(git -C "$APP_ROOT" count-objects)" == "0 objects, 0 kilobytes" ]]; then
|
||||||
|
dokku_log_fail "The fetch subcommand can only be executed for existing applications"
|
||||||
|
fi
|
||||||
|
|
||||||
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
|
||||||
if ! git check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then
|
if ! git check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then
|
||||||
|
|||||||
Reference in new issue
Block a user