summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2016-01-08 22:56:23 -0500
committerFred Hebert <mononcqc@ferd.ca>2016-01-08 22:56:23 -0500
commite496cc8602d4f6706d1d1142331221f736ccb423 (patch)
treede7f73b199fc06d45f2c661cceb746ba9dea31f9
parent99627b161c99dc17fd5614244782424e58e295a2 (diff)
parent136e5921fb10bd6acb5b907b9996e5a085822190 (diff)
Merge pull request #1005 from tsloughter/master
only need to compare ref and not ref+url in git resource
-rw-r--r--src/rebar_git_resource.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rebar_git_resource.erl b/src/rebar_git_resource.erl
index bea74a2..876d047 100644
--- a/src/rebar_git_resource.erl
+++ b/src/rebar_git_resource.erl
@@ -45,7 +45,7 @@ needs_update(Dir, {git, Url, {branch, Branch}}) ->
not ((Current =:= []) andalso compare_url(Dir, Url));
needs_update(Dir, {git, Url, "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", []),
[{cd, Dir}]),
Current1 = string:strip(string:strip(Current, both, $\n), both, $\r),
@@ -64,7 +64,7 @@ needs_update(Dir, {git, Url, Ref}) ->
end,
?DEBUG("Comparing git ref ~s with ~s", [Ref1, Current1]),
- not ((Current1 =:= Ref2) andalso compare_url(Dir, Url)).
+ (Current1 =/= Ref2).
compare_url(Dir, Url) ->
{ok, CurrentUrl} = rebar_utils:sh(?FMT("git config --get remote.origin.url", []),