diff options
author | Tristan Sloughter <t@crashfast.com> | 2014-11-05 10:55:10 -0600 |
---|---|---|
committer | Tristan Sloughter <t@crashfast.com> | 2014-11-05 10:56:23 -0600 |
commit | bc9bb1df49f63f5099288a7a4776164b42d3a5d2 (patch) | |
tree | 30ebaf4589d3ef801605c58313a9f07379b774ef /src | |
parent | fe6827706f951e2744901467c2a0fd95223afd9e (diff) |
support branch/tag/ref-less git deps
Diffstat (limited to 'src')
-rw-r--r-- | src/rebar_fetch.erl | 2 | ||||
-rw-r--r-- | src/rebar_git_resource.erl | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/rebar_fetch.erl b/src/rebar_fetch.erl index 987477f..e763c2c 100644 --- a/src/rebar_fetch.erl +++ b/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}) -> diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl index a6b60d5..6b655de 100644 --- a/src/rebar_git_resource.erl +++ b/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", |