From d5ea97f7b096428d4f0034c8bca8b11675e02816 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 18 Nov 2025 14:07:09 -0500 Subject: [PATCH] chore: consolidate on single method to redirect stdout/stderr to /dev/null --- plugins/git/git-from-directory | 2 +- plugins/git/internal-functions | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/git/git-from-directory b/plugins/git/git-from-directory index 771a7bba9..238fb297b 100755 --- a/plugins/git/git-from-directory +++ b/plugins/git/git-from-directory @@ -18,7 +18,7 @@ trigger-git-git-from-directory() { trap "rm -rf '$TMP_WORK_DIR' '$TMP_WORK_DIR_2' >/dev/null" RETURN INT TERM EXIT local has_code=false - if fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then + if fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then has_code=true fi diff --git a/plugins/git/internal-functions b/plugins/git/internal-functions index 0cd956750..5641cd923 100755 --- a/plugins/git/internal-functions +++ b/plugins/git/internal-functions @@ -211,7 +211,7 @@ cmd-git-sync() { DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" CURRENT_REF="$(fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" 2>/dev/null || true)" - if ! fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then + if ! fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then dokku_log_info1_quiet "Cloning $APP from $GIT_REMOTE#$GIT_REF" fn-git-clone "$APP" "$GIT_REMOTE" "$GIT_REF" else @@ -378,7 +378,7 @@ fn-git-clone() { [[ -z "$APP" ]] && dokku_log_fail "Please specify an app to run the command on" local DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" - if fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then + if fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then dokku_log_fail "The clone subcommand can only be executed for new applications" fi @@ -441,7 +441,7 @@ fn-git-fetch() { local APP_ROOT="$DOKKU_ROOT/$APP" local DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" - if ! fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then + if ! fn-git-cmd "$APP_ROOT" rev-parse "$DOKKU_DEPLOY_BRANCH" &>/dev/null; then dokku_log_fail "The fetch subcommand can only be executed for existing applications" fi