소스 검색

support branch/tag/ref-less git deps

pull/3/head
Tristan Sloughter 10 년 전
부모
커밋
bc9bb1df49
2개의 변경된 파일6개의 추가작업 그리고 2개의 파일을 삭제
  1. +2
    -0
      src/rebar_fetch.erl
  2. +4
    -2
      src/rebar_git_resource.erl

+ 2
- 0
src/rebar_fetch.erl 파일 보기

@ -67,6 +67,8 @@ needs_update(AppDir, Source) ->
end
end.
get_resource_type({Type, Location}) ->
find_resource_module(Type, Location);
get_resource_type({Type, Location, _}) ->
find_resource_module(Type, Location);
get_resource_type({Type, _, _, Location}) ->

+ 4
- 2
src/rebar_git_resource.erl 파일 보기

@ -12,6 +12,8 @@
-include("rebar.hrl").
lock(AppDir, {git, Url, _}) ->
lock(AppDir, {git, Url});
lock(AppDir, {git, Url}) ->
Ref = string:strip(
os:cmd("git --git-dir='" ++ AppDir ++ "/.git' rev-parse --verify HEAD")
,both, $\n),
@ -55,10 +57,10 @@ needs_update(Dir, {git, Url, Ref}) ->
download(Dir, {git, Url}) ->
?WARN("WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.~n", []),
download(Dir, {git, Url, {branch, "HEAD"}});
download(Dir, {git, Url, {branch, "master"}});
download(Dir, {git, Url, ""}) ->
?WARN("WARNING: It is recommended to use {branch, Name}, {tag, Tag} or {ref, Ref}, otherwise updating the dep may not work as expected.~n", []),
download(Dir, {git, Url, {branch, "HEAD"}});
download(Dir, {git, Url, {branch, "master"}});
download(Dir, {git, Url, {branch, Branch}}) ->
ok = filelib:ensure_dir(Dir),
rebar_utils:sh(?FMT("git clone ~s ~s -b ~s --single-branch",

불러오는 중...
취소
저장