about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorErick Tryzelaar <erick.tryzelaar@gmail.com>2012-05-28 18:58:01 -0700
committerErick Tryzelaar <erick.tryzelaar@gmail.com>2012-05-28 18:58:01 -0700
commit7b36d66049e055306e96d912e9e8fb8fb1eda8ec (patch)
tree8a6705c6ef4320c588c206fbf155a9b19c8f537d /src
parent68e5d8daa39a6c61e5730b6daacaa4f608de95ed (diff)
Allow installing arbitrary git cargos
Diffstat (limited to 'src')
-rw-r--r--src/cargo/cargo.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cargo/cargo.rs b/src/cargo/cargo.rs
index 742c7202463..990bbfecde6 100644
--- a/src/cargo/cargo.rs
+++ b/src/cargo/cargo.rs
@@ -713,6 +713,24 @@ fn cmd_install(c: cargo) unsafe {
                install_uuid(c, wd, uuid);
             }
         }
+    } else if str::starts_with(target, "git:") {
+        let ref = if c.opts.free.len() >= 4u {
+            some(c.opts.free[3u])
+        } else {
+            none
+        };
+        install_git(c, wd, target, ref)
+    } else if target == "git" {
+        if c.opts.free.len() < 4u {
+            fail #fmt("needed git url");
+        }
+        let url = c.opts.free[3u];
+        let ref = if c.opts.free.len() >= 5u {
+            some(c.opts.free[4u])
+        } else {
+            none
+        };
+        install_git(c, wd, url, ref)
     } else {
         let mut name = target;
         alt str::find_char(name, '/') {
@@ -891,6 +909,8 @@ Querying:
 Package installation:
     [options] [source/]PKGNAME           Install a package by name
     [options] uuid:[source/]PKGUUID      Install a package by uuid
+    [options] git [url] [ref]            Install a package by git
+    [options] git://[url] [ref]          Install a package by git
 
 Package installation options:
     --mode=MODE    Install to one of the following locations: