From d93a6a91614c8b9f50e3cf86b03bc40938c92f1e Mon Sep 17 00:00:00 2001
From: Edwin Fine <emofine@usa.net>
Date: Sat, 31 Jan 2015 12:14:39 -0500
Subject: [PATCH] Fix issue #14.

rebar added an extra optional element to the dependency tuple,
which is currently only used to specify a "raw" dependency.
This commit handles (but does not interpret) the extra element,
ensuring that the plugin does not skip dependencies that add
that element (such as [raw]).
---
 src/rebar_lock_deps_plugin.erl | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/rebar_lock_deps_plugin.erl b/src/rebar_lock_deps_plugin.erl
index 9d62635..53eafbf 100644
--- a/src/rebar_lock_deps_plugin.erl
+++ b/src/rebar_lock_deps_plugin.erl
@@ -139,9 +139,13 @@ write_rebar_lock(OrigPath, NewPath, NewDeps) ->
     ok.
 
 lock_dep({Name, _Version, {Git, _Url}}, Sha, Url) ->
-        {Name, ".*", {Git, Url, Sha}};
+    {Name, ".*", {Git, Url, Sha}};
+lock_dep({Name, _Version, {Git, _Url}, Extra}, Sha, Url) ->
+    {Name, ".*", {Git, Url, Sha}, Extra};
 lock_dep({Name, Version, {Git, _Url, _Tag}}, Sha, Url) ->
-        lock_dep({Name, Version, {Git, _Url}}, Sha, Url).
+    lock_dep({Name, Version, {Git, _Url}}, Sha, Url);
+lock_dep({Name, Version, {Git, _Url, _Tag}, Extra}, Sha, Url) ->
+    lock_dep({Name, Version, {Git, _Url}, Extra}, Sha, Url).
 
 %% Find the git SHA1s of all the dependencies in `DepsDir' and return
 %% as a list of {Name, Sha} tuples where Name is an atom and Sha is a
@@ -186,8 +190,14 @@ read_all_deps(Config, Dir) ->
      {filename:basename(D), dep_names(extract_deps(D))}
      || D <- DepDirs ].
 
-dep_names(Deps) ->
-    [ erlang:atom_to_list(Name) || {Name, _, _} <- Deps ].
+dep_names([{Name, _Version, _GitSpec} | T]) ->
+    [erlang:atom_to_list(Name) | dep_names(T)];
+dep_names([{Name, _Version, _GitSpec, _Extra} | T]) ->
+    [erlang:atom_to_list(Name) | dep_names(T)];
+dep_names([_Skip | T]) ->
+    dep_names(T);
+dep_names([]) ->
+    [].
 
 de_dup(AccIn) ->
     WithIndex = lists:zip(AccIn, lists:seq(1, length(AccIn))),