From f3c56849c1defd7f75bd57965451b1d9c468c974 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 2 Jan 2018 17:39:23 -0200 Subject: git.lua: avoid quoting difficulties on Windows --- src/luarocks/fetch/git.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua index 27864989..efd62e6d 100644 --- a/src/luarocks/fetch/git.lua +++ b/src/luarocks/fetch/git.lua @@ -54,7 +54,7 @@ local function git_identifier(git_cmd, ver) if not (ver:match("^dev%-%d+$") or ver:match("^scm%-%d+$")) then return nil end - local pd = io.popen(fs.command_at(fs.current_dir(), fs.Q(git_cmd).." log --pretty=format:'%ai %h' -n 1")) + local pd = io.popen(fs.command_at(fs.current_dir(), fs.Q(git_cmd).." log --pretty=format:%ai_%h -n 1")) if not pd then return nil end @@ -63,7 +63,7 @@ local function git_identifier(git_cmd, ver) if not date_hash then return nil end - local date, time, tz, hash = date_hash:match("([^%s]+) ([^%s]+) ([^%s]+) ([^%s]+)") + local date, time, tz, hash = date_hash:match("([^%s]+) ([^%s]+) ([^%s]+)_([^%s]+)") date = date:gsub("%-", "") time = time:gsub(":", "") return date .. "." .. time .. "." .. hash -- cgit v1.2.3-55-g6feb