mirror of
https://github.com/correl/rebar.git
synced 2024-12-18 03:00:17 +00:00
Fix git tag and branch dependency handling
Change git downloads and updates to not create branches and fix git tag handling.
This commit is contained in:
parent
b2e7e5b787
commit
064195dc5a
1 changed files with 8 additions and 6 deletions
|
@ -278,11 +278,11 @@ download_source(AppDir, {hg, Url, Rev}) ->
|
||||||
download_source(AppDir, {git, Url, {branch, Branch}}) ->
|
download_source(AppDir, {git, Url, {branch, Branch}}) ->
|
||||||
ok = filelib:ensure_dir(AppDir),
|
ok = filelib:ensure_dir(AppDir),
|
||||||
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
|
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
|
||||||
rebar_utils:sh(?FMT("git checkout ~s", [Branch]), [], AppDir);
|
rebar_utils:sh(?FMT("git checkout -q origin/~s", [Branch]), [], AppDir);
|
||||||
download_source(AppDir, {git, Url, {tag, Tag}}) ->
|
download_source(AppDir, {git, Url, {tag, Tag}}) ->
|
||||||
ok = filelib:ensure_dir(AppDir),
|
ok = filelib:ensure_dir(AppDir),
|
||||||
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
|
rebar_utils:sh(?FMT("git clone -n ~s ~s", [Url, filename:basename(AppDir)]), [], filename:dirname(AppDir)),
|
||||||
rebar_utils:sh(?FMT("git checkout -b ~s", [Tag]), [], AppDir);
|
rebar_utils:sh(?FMT("git checkout -q ~s", [Tag]), [], AppDir);
|
||||||
download_source(AppDir, {git, Url, Rev}) ->
|
download_source(AppDir, {git, Url, Rev}) ->
|
||||||
download_source(AppDir, {git, Url, {branch, Rev}});
|
download_source(AppDir, {git, Url, {branch, Rev}});
|
||||||
download_source(AppDir, {bzr, Url, Rev}) ->
|
download_source(AppDir, {bzr, Url, Rev}) ->
|
||||||
|
@ -303,10 +303,12 @@ update_source(Dep) ->
|
||||||
Dep#dep.source),
|
Dep#dep.source),
|
||||||
Dep.
|
Dep.
|
||||||
|
|
||||||
update_source(AppDir, {git, _Url, {Type, Refspec}})
|
update_source(AppDir, {git, _Url, {branch, Branch}}) ->
|
||||||
when Type =:= branch orelse
|
rebar_utils:sh(?FMT("git fetch origin", []), [], AppDir),
|
||||||
Type =:= tag ->
|
rebar_utils:sh(?FMT("git checkout -q origin/~s", [Branch]), [], AppDir);
|
||||||
rebar_utils:sh(?FMT("git pull origin ~s", [Refspec]), [], AppDir);
|
update_source(AppDir, {git, _Url, {tag, Tag}}) ->
|
||||||
|
rebar_utils:sh(?FMT("git fetch --tags origin", []), [], AppDir),
|
||||||
|
rebar_utils:sh(?FMT("git checkout -q ~s", [Tag]), [], AppDir);
|
||||||
update_source(AppDir, {git, Url, Refspec}) ->
|
update_source(AppDir, {git, Url, Refspec}) ->
|
||||||
update_source(AppDir, {git, Url, {branch, Refspec}});
|
update_source(AppDir, {git, Url, {branch, Refspec}});
|
||||||
update_source(AppDir, {svn, _Url, Rev}) ->
|
update_source(AppDir, {svn, _Url, Rev}) ->
|
||||||
|
|
Loading…
Reference in a new issue