Permalink
Browse files

Fixed broken indices chaining

  • Loading branch information...
1 parent c5560cb commit 36799d9dc98669927ac29db246263f3b83b733e9 @yrashk yrashk committed Feb 25, 2011
Showing with 12 additions and 3 deletions.
  1. BIN rebar
  2. +6 −1 src/agner_github.erl
  3. +6 −2 src/agner_repo_server.erl
View
BIN rebar
Binary file not shown.
View
@@ -193,7 +193,12 @@ spec_1(Account, RepoServer, AtFilename) ->
{ok, S} = file:consult(AtFilename),
S
end,
- agner_spec:normalize(Spec).
+ case Spec of
+ {error, _} = Error ->
+ Error;
+ _ ->
+ agner_spec:normalize(Spec)
+ end.
spec_url(Account, Name, SHA1) ->
"https://github.com/" ++ proper_repo_name(Account, Name) ++ "/blob/" ++ SHA1 ++ "/agner.config".
@@ -73,7 +73,6 @@ clone(Pid, Fun) ->
file(Pid, Filename) ->
gen_server:call(Pid, {file, Filename}).
-
%%%===================================================================
%%% gen_server callbacks
%%%===================================================================
@@ -139,7 +138,12 @@ handle_call({clone, Fun}, _From, #state{ directory = undefined, name = Name, ver
ok
end)
end),
- {reply, Result, State#state{ directory = Directory }};
+ case Result of
+ ok ->
+ {reply, ok, State#state{ directory = Directory }};
+ _ ->
+ {reply, Result, State}
+ end;
handle_call({clone, _Fun}, _From, #state{} = State) -> %% already cloned
{reply, ok, State};

0 comments on commit 36799d9

Please sign in to comment.