diff options
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 |
