diff options
| author | ruki <[email protected]> | 2021-08-20 00:30:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-20 00:30:50 +0800 |
| commit | 8255e9894b9d1b29ecb479190ab2e9f1e6e8388c (patch) | |
| tree | 5ecf4a3916093cff6aaa81d49e4081a18cd4fd78 | |
| parent | d96dd2ca564aca5ad0780feb9c14f57b76c693d2 (diff) | |
improve to pull locked repo
| -rw-r--r-- | xmake/modules/private/action/require/impl/repository.lua | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/xmake/modules/private/action/require/impl/repository.lua b/xmake/modules/private/action/require/impl/repository.lua index b38bc95d3..a2764916d 100644 --- a/xmake/modules/private/action/require/impl/repository.lua +++ b/xmake/modules/private/action/require/impl/repository.lua @@ -27,7 +27,6 @@ import("devel.git") -- get package directory from the locked repository function _get_packagedir_from_locked_repo(packagename, locked_repo) - print(packagename, locked_repo) -- find global repository directory local repodir_global @@ -39,7 +38,7 @@ function _get_packagedir_from_locked_repo(packagename, locked_repo) end -- clone repository to local - local reponame = path.basename(locked_repo.url) + local reponame = path.basename(locked_repo.url) .. ".lock" local repodir_local = path.join(config.directory(), "repositories", reponame) if not os.isdir(repodir_local) then if repodir_global then @@ -57,7 +56,7 @@ function _get_packagedir_from_locked_repo(packagename, locked_repo) if not ok then if global.get("network") ~= "private" then -- pull the latest commit - git.pull({verbose = option.get("verbose"), branch = locked_repo.branch, repodir = repodir_local}) + git.pull({verbose = option.get("verbose"), remote = locked_repo.url, branch = locked_repo.branch, repodir = repodir_local}) -- re-checkout to the given commit ok = try {function () git.checkout(locked_repo.commit, {verbose = option.get("verbose"), repodir = repodir_local}); return true end} else |
