From d3e85f9afd35adbc5c47df44e346095a4535f45f Mon Sep 17 00:00:00 2001 From: Sergio Durigan Junior Date: Tue, 23 Dec 2014 02:36:01 -0500 Subject: [PATCH] Only create commit and tag if tag does not exist --- lib/gdbgitdb.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/gdbgitdb.py b/lib/gdbgitdb.py index 927d2f2..f5e23b6 100644 --- a/lib/gdbgitdb.py +++ b/lib/gdbgitdb.py @@ -27,9 +27,10 @@ class SaveGDBResults (ShellCommand): # Do nothing return SUCCESS repo = git.Repo.init (path = repodir) - 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) + if rev not in repo.tags: + 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) return SUCCESS