From b44959ede49e13aa547938f8a4f5c993af137c25 Mon Sep 17 00:00:00 2001 From: "Paulo F. Oliveira" Date: Thu, 29 Oct 2020 01:00:18 +0000 Subject: [PATCH] Prevent warnings on seemingly dead code --- src/rebar_git_resource.erl | 24 +----------------------- src/rebar_paths.erl | 6 +----- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl index d95fd597..d974d5dc 100644 --- a/src/rebar_git_resource.erl +++ b/src/rebar_git_resource.erl @@ -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. diff --git a/src/rebar_paths.erl b/src/rebar_paths.erl index d2bc59d3..ed3f13ce 100644 --- a/src/rebar_paths.erl +++ b/src/rebar_paths.erl @@ -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) ->