瀏覽代碼

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, _} -> {error, _} ->
{undefined, "0.0.0"}; {undefined, "0.0.0"};
{ok, Line} -> {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]} -> {match,[Tag, Vsn]} ->
{Tag, Vsn}; {Tag, Vsn};
nomatch -> nomatch ->

Loading…
取消
儲存