Browse Source

Merge pull request #1005 from tsloughter/master

only need to compare ref and not ref+url in git resource
pull/1007/head
Fred Hebert 9 years ago
parent
commit
e496cc8602
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/rebar_git_resource.erl

+ 2
- 2
src/rebar_git_resource.erl View File

@ -45,7 +45,7 @@ needs_update(Dir, {git, Url, {branch, Branch}}) ->
not ((Current =:= []) andalso compare_url(Dir, Url)); not ((Current =:= []) andalso compare_url(Dir, Url));
needs_update(Dir, {git, Url, "master"}) -> needs_update(Dir, {git, Url, "master"}) ->
needs_update(Dir, {git, Url, {branch, "master"}}); needs_update(Dir, {git, Url, {branch, "master"}});
needs_update(Dir, {git, Url, Ref}) ->
needs_update(Dir, {git, _, Ref}) ->
{ok, Current} = rebar_utils:sh(?FMT("git rev-parse -q HEAD", []), {ok, Current} = rebar_utils:sh(?FMT("git rev-parse -q HEAD", []),
[{cd, Dir}]), [{cd, Dir}]),
Current1 = string:strip(string:strip(Current, both, $\n), both, $\r), Current1 = string:strip(string:strip(Current, both, $\n), both, $\r),
@ -64,7 +64,7 @@ needs_update(Dir, {git, Url, Ref}) ->
end, end,
?DEBUG("Comparing git ref ~s with ~s", [Ref1, Current1]), ?DEBUG("Comparing git ref ~s with ~s", [Ref1, Current1]),
not ((Current1 =:= Ref2) andalso compare_url(Dir, Url)).
(Current1 =/= Ref2).
compare_url(Dir, Url) -> compare_url(Dir, Url) ->
{ok, CurrentUrl} = rebar_utils:sh(?FMT("git config --get remote.origin.url", []), {ok, CurrentUrl} = rebar_utils:sh(?FMT("git config --get remote.origin.url", []),

Loading…
Cancel
Save