From ed8ecf751f73c2e1b4fc690ba4dcfe511d8f0d26 Mon Sep 17 00:00:00 2001 From: Benjamin Nortier Date: Wed, 15 Sep 2010 11:10:53 +0100 Subject: Added support for checking out tags from git --- src/rebar_deps.erl | 10 ++++++++-- 1 file 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", -- cgit v1.1