Skip to content

Commit 0823496

Browse files
committed
Do not try to get Git revision in git.rev_parse if the directory is not a repo.
1 parent 9e5b9ab commit 0823496

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

build/scripts/Utils.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ function git.checkout(dir, rev)
7474
end
7575

7676
function git.rev_parse(dir, rev)
77+
if not os.isdir(dir .. "/.git") then
78+
return nil
79+
end
7780
local cmd = "git -C " .. path.translate(dir, sep) .. " rev-parse " .. rev
7881
return outputof(cmd)
7982
end

0 commit comments

Comments
 (0)