Skip to content

Commit

Permalink
Bad merge, re added removed functions.
Browse files Browse the repository at this point in the history
Raoul Hess committed Nov 6, 2014
1 parent fd0ac33 commit 17d2293
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/component_handler.erl
Original file line number Diff line number Diff line change
@@ -88,25 +88,6 @@ handle_post(Req, _State=#state{}) ->
end,
{ok, Req3}.

find_latest_tag([]) ->
<<"">>;
find_latest_tag(Tags) ->
NumericTags = lists:filter(fun(X) ->
case re:run(X, "^\\d+(\\.\\d){0,2}$") of
nomatch -> false; _ -> true
end
end, Tags),
case NumericTags of
[] -> <<"HEAD">>;
_ ->
SortFun = fun(Tag1, Tag2) ->
Tag1Parts = binary:split(Tag1, <<".">>),
Tag2Parts = binary:split(Tag2, <<".">>),
lists:all(fun({Tag1Part, Tag2Part}) -> Tag1Part =< Tag2Part end, lists:zip(Tag1Parts, Tag2Parts))
end,
lists:last(lists:sort(SortFun, NumericTags))
end.

find_latest_patch(PrefixTag, Tags) ->
lists:foldl(fun(Tag, LatestPatch) ->
case binary:longest_common_prefix([Tag, PrefixTag])of

0 comments on commit 17d2293

Please sign in to comment.