diff options
author | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2012-05-14 17:52:14 -0300 |
---|---|---|
committer | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2012-05-14 17:52:14 -0300 |
commit | b2ebea13c7f340591fa083f061f093c453108bfc (patch) | |
tree | b27fd262f78f185ec229282f8d2ce59375d5a849 /src | |
parent | 0fb1cbd7802b0629f5a99ff4ee4616132f08d31d (diff) | |
download | luarocks-b2ebea13c7f340591fa083f061f093c453108bfc.tar.gz luarocks-b2ebea13c7f340591fa083f061f093c453108bfc.tar.bz2 luarocks-b2ebea13c7f340591fa083f061f093c453108bfc.zip |
git checkout is not needed anymore
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fetch/git.lua | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua index b7df6372..42129b22 100644 --- a/src/luarocks/fetch/git.lua +++ b/src/luarocks/fetch/git.lua | |||
@@ -23,12 +23,10 @@ function get_sources(rockspec, extract, dest_dir) | |||
23 | -- Strip off .git from base name if present | 23 | -- Strip off .git from base name if present |
24 | module = module:gsub("%.git$", "") | 24 | module = module:gsub("%.git$", "") |
25 | local command = {git_cmd, "clone", "--depth=1", rockspec.source.url, module} | 25 | local command = {git_cmd, "clone", "--depth=1", rockspec.source.url, module} |
26 | local checkout_command | ||
27 | local tag_or_branch = rockspec.source.tag or rockspec.source.branch | 26 | local tag_or_branch = rockspec.source.tag or rockspec.source.branch |
28 | if tag_or_branch then | 27 | if tag_or_branch then |
29 | -- ensure the branch (or tag) is available | 28 | -- ensure the branch (or tag) is available |
30 | table.insert(command, 4, "--branch=" .. tag_or_branch) | 29 | table.insert(command, 4, "--branch=" .. tag_or_branch) |
31 | checkout_command = {git_cmd, "checkout", tag_or_branch} | ||
32 | end | 30 | end |
33 | local store_dir | 31 | local store_dir |
34 | if not dest_dir then | 32 | if not dest_dir then |
@@ -45,11 +43,6 @@ function get_sources(rockspec, extract, dest_dir) | |||
45 | return nil, "Failed cloning git repository." | 43 | return nil, "Failed cloning git repository." |
46 | end | 44 | end |
47 | fs.change_dir(module) | 45 | fs.change_dir(module) |
48 | if checkout_command then | ||
49 | if not fs.execute(unpack(checkout_command)) then | ||
50 | return nil, "Failed checking out tag/branch from git repository." | ||
51 | end | ||
52 | end | ||
53 | fs.delete(dir.path(store_dir, module, ".git")) | 46 | fs.delete(dir.path(store_dir, module, ".git")) |
54 | fs.delete(dir.path(store_dir, module, ".gitignore")) | 47 | fs.delete(dir.path(store_dir, module, ".gitignore")) |
55 | fs.pop_dir() | 48 | fs.pop_dir() |