Merge pull request #15 from JackSullivan/patch-1

Added support for tags
master
Martin Gondermann 13 years ago
commit e55126a129
  1. 5
      gitstatus.py

@ -40,7 +40,12 @@ else:
remote = '' remote = ''
tag, tag_error = Popen(['git', 'describe', '--exact-match'], stdout=PIPE, stderr=PIPE).communicate()
if not branch: # not on any branch if not branch: # not on any branch
if tag: # if we are on a tag, print the tag's name
branch = tag
else:
branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1] branch = symbols['prehash']+ Popen(['git','rev-parse','--short','HEAD'], stdout=PIPE).communicate()[0][:-1]
else: else:
remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip() remote_name = Popen(['git','config','branch.%s.remote' % branch], stdout=PIPE).communicate()[0].strip()

Loading…
Cancel
Save