From 38b03e2b180c9236bc58c49e3a157aee0cdc224f Mon Sep 17 00:00:00 2001 From: KoffeinFlummi Date: Fri, 8 May 2015 19:37:14 +0200 Subject: [PATCH] Only commit if there's something to do --- tools/deploy.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/deploy.py b/tools/deploy.py index baefbf44e2..501987810a 100755 --- a/tools/deploy.py +++ b/tools/deploy.py @@ -57,8 +57,12 @@ def deploy_documentation(token): shutil.copyfile(os.path.join(root, name), os.path.join(target, name)) sp.check_call(["git", "add", "--all", "."]) - sp.check_call(["git", "commit", "-m", "Automatic gh-pages deployment"]) - sp.check_call(["git", "push", "origin", "gh-pages"], stdout=devnull, stderr=devnull) + + filenum = sp.check_output(["git", "status", "--porcelain"]) + filenum = len(str(filenum, "utf-8").split("\n")) - 1 + if filenum > 0: + sp.check_call(["git", "commit", "-m", "Automatic gh-pages deployment"]) + sp.check_call(["git", "push", "origin", "gh-pages"], stdout=devnull, stderr=devnull) os.chdir("..")