Procházet zdrojové kódy

Prevent warnings on seemingly dead code

pull/2412/head
Paulo F. Oliveira před 4 roky
rodič
revize
b44959ede4
2 změnil soubory, kde provedl 2 přidání a 28 odebrání
  1. +1
    -23
      src/rebar_git_resource.erl
  2. +1
    -5
      src/rebar_paths.erl

+ 1
- 23
src/rebar_git_resource.erl Zobrazit soubor

@ -253,16 +253,7 @@ git_vsn_fetch() ->
make_vsn(AppInfo, _) ->
Dir = rebar_app_info:dir(AppInfo),
case rebar_app_info:original_vsn(AppInfo) of
{git, short} ->
git_ref(Dir, "--short");
{git, long} ->
git_ref(Dir, "");
_ ->
%% already parsed in rebar_utils to get here so we know it
%% is either for git or "git"
make_vsn_(Dir)
end.
make_vsn_(Dir).
make_vsn_(Dir) ->
case collect_default_refcount(Dir) of
@ -274,19 +265,6 @@ make_vsn_(Dir) ->
%% Internal functions
git_ref(Dir, Arg) ->
case rebar_utils:sh("git rev-parse " ++ Arg ++ " HEAD",
[{use_stdout, false},
return_on_error,
{cd, Dir}]) of
{error, _} ->
?WARN("Getting ref of git repo failed in ~ts. "
"Falling back to version 0", [Dir]),
{plain, "0"};
{ok, String} ->
{plain, rebar_string:trim(String, both, "\n")}
end.
collect_default_refcount(Dir) ->
%% Get the tag timestamp and minimal ref from the system. The
%% timestamp is really important from an ordering perspective.

+ 1
- 5
src/rebar_paths.erl Zobrazit soubor

@ -209,11 +209,7 @@ get_apps(deps, State) ->
%% The code paths for deps also include the top level apps
%% and the extras, which we don't have here; we have to
%% add the apps by hand
case rebar_state:project_apps(State) of
undefined -> [];
List -> List
end ++
rebar_state:all_deps(State);
rebar_state:project_apps(State) ++ rebar_state:all_deps(State);
get_apps(plugins, State) ->
rebar_state:all_plugin_deps(State);
get_apps(runtime, State) ->

Načítá se…
Zrušit
Uložit