From dd157ba82255727e0095925eaf8d64fbfe89b275 Mon Sep 17 00:00:00 2001 From: gavin Date: Tue, 4 Aug 2020 17:39:35 +0530 Subject: [PATCH] fix: dont show git errors in terminal (#11064) Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> --- frappe/utils/change_log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frappe/utils/change_log.py b/frappe/utils/change_log.py index 53c83cfe99..c75b3289db 100644 --- a/frappe/utils/change_log.py +++ b/frappe/utils/change_log.py @@ -118,8 +118,9 @@ def get_versions(): def get_app_branch(app): '''Returns branch of an app''' try: + null_stream = open(os.devnull, 'wb') result = subprocess.check_output('cd ../apps/{0} && git rev-parse --abbrev-ref HEAD'.format(app), - shell=True) + shell=True, stdin=null_stream, stderr=null_stream) result = safe_decode(result) result = result.strip() return result @@ -128,8 +129,9 @@ def get_app_branch(app): def get_app_last_commit_ref(app): try: + null_stream = open(os.devnull, 'wb') result = subprocess.check_output('cd ../apps/{0} && git rev-parse HEAD --short 7'.format(app), - shell=True) + shell=True, stdin=null_stream, stderr=null_stream) result = safe_decode(result) result = result.strip() return result