浏览代码

Support 2 forms of implicit HEAD for git

In git origin/HEAD is a pointer to the default branch.  This patch
allows two alternatives to explicitly specifying "HEAD" in git VC specs.

The first is a 2 arity form {git, Url} and the second is {git, Url, ""}
which worked in pre-update-deps rebars.
pull/3/head
David Reid 14 年前
提交者 Tuncer Ayaz
父节点
当前提交
3241165ced
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. +8
    -0
      src/rebar_deps.erl

+ 8
- 0
src/rebar_deps.erl 查看文件

@ -303,6 +303,10 @@ download_source(AppDir, {hg, Url, Rev}) ->
rebar_utils:sh(?FMT("hg clone -U ~s ~s", [Url, filename:basename(AppDir)]),
[{cd, filename:dirname(AppDir)}]),
rebar_utils:sh(?FMT("hg update ~s", [Rev]), [{cd, AppDir}]);
download_source(AppDir, {git, Url}) ->
download_source(AppDir, {git, Url, "HEAD"});
download_source(AppDir, {git, Url, ""}) ->
download_source(AppDir, {git, Url, "HEAD"});
download_source(AppDir, {git, Url, {branch, Branch}}) ->
ok = filelib:ensure_dir(AppDir),
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]),
@ -344,6 +348,10 @@ update_source(Dep) ->
Dep
end.
update_source(AppDir, {git, Url}) ->
update_source(AppDir, {git, Url, "HEAD"});
update_source(AppDir, {git, Url, ""}) ->
update_source(AppDir, {git, Url, "HEAD"});
update_source(AppDir, {git, _Url, {branch, Branch}}) ->
ShOpts = [{cd, AppDir}],
rebar_utils:sh("git fetch origin", ShOpts),

正在加载...
取消
保存