summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/rebar_deps.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl
index 99ede3d..69f5fc1 100644
--- a/src/rebar_deps.erl
+++ b/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),