From 299ea84e251571cee9a6dcf677d9d1e68d240c76 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 2 Jan 2018 16:43:03 -0200 Subject: Catch error when git fails to read the hash --- src/luarocks/fetch/git.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua index 2b8adc78..ff66f7fe 100644 --- a/src/luarocks/fetch/git.lua +++ b/src/luarocks/fetch/git.lua @@ -55,6 +55,9 @@ local function git_identifier(git_cmd, ver) return nil end local date_hash = util.popen_read(fs.Q(git_cmd).." log --pretty=format:'%ai %h' -n 1") + if not date_hash then + return nil + end local date, time, tz, hash = date_hash:match("([^%s]+) ([^%s]+) ([^%s]+) ([^%s]+)") date = date:gsub("%-", "") time = time:gsub(":", "") -- cgit v1.2.3-55-g6feb