From 9635be1ae7dc26686a46b2c6f0ffee3a86d58b44 Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Tue, 23 Dec 2014 02:16:43 -0500 Subject: [PATCH] Using is_dirty to know when to commit things --- lib/gdbgitdb.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/gdbgitdb.py b/lib/gdbgitdb.py index 672e837..927d2f2 100644 --- a/lib/gdbgitdb.py +++ b/lib/gdbgitdb.py @@ -27,8 +27,9 @@ class SaveGDBResults (ShellCommand): # Do nothing return SUCCESS repo = git.Repo.init (path = repodir) - repo.index.add (['gdb.sum', 'gdb.log', '%s/baseline' % branch]) - repo.index.commit ('Log files for %s' % rev) + if repo.is_dirty (): + repo.index.add (['gdb.sum', 'gdb.log', '%s/baseline' % branch]) + repo.index.commit ('Log files for %s' % rev) + repo.index.write () repo.create_tag (rev) - repo.index.write () return SUCCESS