# compatible
remote_tag = [tag for tag in gitrepo.tags if tag.name == new_tag]
if not do_autoincrement and len(remote_tag) > 0:
- # FIXME: .id attribute but avl. in wheezy based git lib
- if remote_tag[0].commit.id == curr_commit_id:
+ tagged_commit = remote_tag[0].commit
+ if hasattr(tagged_commit, 'hexsha'):
+ tagged_commit_hexsha = tagged_commit.hexsha
+ else:
+ tagged_commit_hexsha = tagged_commit.id
+ if tagged_commit_hexsha == curr_commit_id:
message = 'Tag {name} was already created for commit {sha}.'.format(
name=remote_tag[0].name,
- sha=remote_tag[0].commit.id[0:7],
+ sha=tagged_commit[0:7],
)
logger.debug(message)
do_tagging = False
else:
logger.error('Tag {name} was already created for commit {sha}.'.format(
name=remote_tag[0].name,
- sha=remote_tag[0].commit.id[0:7],
+ sha=tagged_commit[0:7],
))
exit_error()
else: