Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/fetch/git.lua')
-rw-r--r--src/luarocks/fetch/git.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua
index 53fd444..a635f19 100644
--- a/src/luarocks/fetch/git.lua
+++ b/src/luarocks/fetch/git.lua
@@ -40,6 +40,11 @@ function git.get_sources(rockspec, extract, dest_dir, depth)
-- Strip off .git from base name if present
module = module:gsub("%.git$", "")
+ local ok, err_msg = fs.is_tool_available(git_cmd, "Git")
+ if not ok then
+ return nil, err_msg
+ end
+
local store_dir
if not dest_dir then
store_dir = fs.make_temp_dir(name_version)
@@ -63,7 +68,7 @@ function git.get_sources(rockspec, extract, dest_dir, depth)
if git_can_clone_by_tag(git_cmd) then
-- The argument to `--branch` can actually be a branch or a tag as of
-- Git 1.7.10.
- table.insert(command, 4, "--branch=" .. tag_or_branch)
+ table.insert(command, 3, "--branch=" .. tag_or_branch)
end
end
if not fs.execute(unpack(command)) then