浏览代码

git-url: use git branch --show-current

raylu 2 年之前
父节点
当前提交
de6e6ba941
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      git-url

+ 1 - 1
git-url

@@ -9,7 +9,7 @@ def oneliner(*args):
 	return subprocess.check_output(args, universal_newlines=True).strip()
 
 commit = oneliner('git', 'rev-parse', 'HEAD')
-local_branch = oneliner('git', 'name-rev', '--name-only', 'HEAD')
+local_branch = oneliner('git', 'branch', '--show-current')
 
 tag = None
 if local_branch.startswith('tags/'):