summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Nortier <bjnortier@gmail.com>2010-09-15 11:10:53 +0100
committerBenjamin Nortier <bjnortier@gmail.com>2010-09-15 11:10:53 +0100
commited8ecf751f73c2e1b4fc690ba4dcfe511d8f0d26 (patch)
tree6a9c43fc5e74baed15560e4e881f570cb712b668
parent83cece0f80ccf18f8fb9d41a5052d82ea025a3ec (diff)
Added support for checking out tags from git
-rw-r--r--src/rebar_deps.erl10
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",