diff options
| author | ruki <[email protected]> | 2021-08-21 10:16:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-08-21 10:16:45 +0800 |
| commit | 875fdfe22fb96ff5ef2b654b276acd363f2b906b (patch) | |
| tree | 4221aaa71bea36f1d555228e4bff0b68020d7ca0 /xmake/modules/private/action/require/impl/lock_packages.lua | |
| parent | bc582fd4bdaee3add88a4e15f1764c7e11eec41c (diff) | |
improve lock packages
Diffstat (limited to 'xmake/modules/private/action/require/impl/lock_packages.lua')
| -rw-r--r-- | xmake/modules/private/action/require/impl/lock_packages.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/private/action/require/impl/lock_packages.lua b/xmake/modules/private/action/require/impl/lock_packages.lua index 18dabcac4..05debf6f2 100644 --- a/xmake/modules/private/action/require/impl/lock_packages.lua +++ b/xmake/modules/private/action/require/impl/lock_packages.lua @@ -43,7 +43,11 @@ function _lock_package(instance) result.branch = instance:branch() result.tag = instance:tag() if repo then - local lastcommit = git.lastcommit({repodir = repo:directory()}) + local lastcommit = try {function() + if os.isdir(path.join(repo:directory(), ".git")) then + return git.lastcommit({repodir = repo:directory()}) + end + end} result.repo = {url = repo:url(), commit = lastcommit, branch = repo:branch()} end return result |
