diff options
Diffstat (limited to 'src/rebar_deps.erl')
-rw-r--r-- | src/rebar_deps.erl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/rebar_deps.erl b/src/rebar_deps.erl index 1e344a7..641f92c 100644 --- a/src/rebar_deps.erl +++ b/src/rebar_deps.erl @@ -269,10 +269,16 @@ download_source(AppDir, {hg, Url, Rev}) -> ok = filelib:ensure_dir(AppDir), rebar_utils:sh(?FMT("hg clone -U ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)), rebar_utils:sh(?FMT("hg update ~s", [Rev]), [], AppDir); -download_source(AppDir, {git, Url, Rev}) -> +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)]), [], filename:dirname(AppDir)), + rebar_utils:sh(?FMT("git checkout ~s", [Branch]), [], AppDir); +download_source(AppDir, {git, Url, {tag, Tag}}) -> ok = filelib:ensure_dir(AppDir), rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)), - rebar_utils:sh(?FMT("git checkout ~s", [Rev]), [], AppDir); + rebar_utils:sh(?FMT("git checkout -b ~s", [Tag]), [], AppDir); +download_source(AppDir, {git, Url, Rev}) -> + download_source(AppDir, {git, Url, {branch, Rev}}); download_source(AppDir, {bzr, Url, Rev}) -> ok = filelib:ensure_dir(AppDir), rebar_utils:sh(?FMT("bzr branch -r ~s ~s ~s", |