aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-01-02 16:43:03 -0200
committerHisham Muhammad <hisham@gobolinux.org>2018-01-02 16:43:03 -0200
commit299ea84e251571cee9a6dcf677d9d1e68d240c76 (patch)
treec759c5fa00f200f9cf5d55a19b2cd7359da300d9
parent0f32a2b1f2ba42289e214efea95d46a1939abe76 (diff)
downloadluarocks-299ea84e251571cee9a6dcf677d9d1e68d240c76.tar.gz
luarocks-299ea84e251571cee9a6dcf677d9d1e68d240c76.tar.bz2
luarocks-299ea84e251571cee9a6dcf677d9d1e68d240c76.zip
Catch error when git fails to read the hash
-rw-r--r--src/luarocks/fetch/git.lua3
1 files changed, 3 insertions, 0 deletions
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)
55 return nil 55 return nil
56 end 56 end
57 local date_hash = util.popen_read(fs.Q(git_cmd).." log --pretty=format:'%ai %h' -n 1") 57 local date_hash = util.popen_read(fs.Q(git_cmd).." log --pretty=format:'%ai %h' -n 1")
58 if not date_hash then
59 return nil
60 end
58 local date, time, tz, hash = date_hash:match("([^%s]+) ([^%s]+) ([^%s]+) ([^%s]+)") 61 local date, time, tz, hash = date_hash:match("([^%s]+) ([^%s]+) ([^%s]+) ([^%s]+)")
59 date = date:gsub("%-", "") 62 date = date:gsub("%-", "")
60 time = time:gsub(":", "") 63 time = time:gsub(":", "")