浏览代码

Only match current HEAD tag in git semver

In the scenario that someone had cloned an entire
repository and then checked out an older version
tag, the semantic versioning would detect the
newest tag, not the checked out tag. Look for
the HEAD string prior to tag: to indicate the
currently selected tag.
pull/825/head
Zachary Hueras 9 年前
父节点
当前提交
a70c1baf79
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      src/rebar_git_resource.erl

+ 1
- 1
src/rebar_git_resource.erl 查看文件

@ -194,7 +194,7 @@ parse_tags(Dir) ->
{error, _} ->
{undefined, "0.0.0"};
{ok, Line} ->
case re:run(Line, "(\\(|\\s)tag:\\s(v?([^,\\)]+))", [{capture, [2, 3], list}]) of
case re:run(Line, "(\\(|\\s)(HEAD,\\s)tag:\\s(v?([^,\\)]+))", [{capture, [3, 4], list}]) of
{match,[Tag, Vsn]} ->
{Tag, Vsn};
nomatch ->

正在加载...
取消
保存