summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert G. Jakabosky <bobby@sharedrealm.com>2011-01-08 05:04:41 -0800
committerRobert G. Jakabosky <bobby@sharedrealm.com>2011-01-08 05:04:41 -0800
commitc9043f93e1d0292c5396c86344d90163028fa0a7 (patch)
tree271f97b9f952de7210e38ceaa89a7d7ad6c2d86c
parentacad1ef8c64fc3526347be8e268f7f1745ef2b76 (diff)
downloadluagit2-c9043f93e1d0292c5396c86344d90163028fa0a7.tar.gz
Fixed building from rockspec.
-rwxr-xr-xCMakeLists.txt2
-rw-r--r--README.md10
-rw-r--r--git2.nobj.lua1
-rw-r--r--pre_generated-git2.nobj.c1
-rw-r--r--test_backend.lua14
5 files changed, 22 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5bca13e..5c151e7 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,6 +49,8 @@ include(LuaNativeObjects)
configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake
${CMAKE_SOURCE_DIR}/build/config.h)
+set(COMMON_CFLAGS "${COMMON_CFLAGS} -include ${CMAKE_SOURCE_DIR}/build/config.h")
+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${LUA_INCLUDE_DIR})
diff --git a/README.md b/README.md
index 1657367..2927dc5 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,16 @@ luagit2
LibGit2 bindings for Lua.
+Installing
+----------
+
+### Install lua-git2:
+
+curl -O "https://github.com/Neopallium/luagit2/raw/master/lua-git2-scm-0.rockspec"
+
+luarocks install lua-git2-scm-0.rockspec
+
+
Build Dependencies
------------------
diff --git a/git2.nobj.lua b/git2.nobj.lua
index 6aef684..47e703a 100644
--- a/git2.nobj.lua
+++ b/git2.nobj.lua
@@ -5,7 +5,6 @@ use_globals = false,
hide_meta_info = false, --true,
include "git2.h",
-include "config.h",
package "GIT" {
const "SUCCESS" { 0 },
diff --git a/pre_generated-git2.nobj.c b/pre_generated-git2.nobj.c
index 8b7e125..3ca7bea 100644
--- a/pre_generated-git2.nobj.c
+++ b/pre_generated-git2.nobj.c
@@ -11,7 +11,6 @@
#include "lualib.h"
#include "git2.h"
-#include "config.h"
#define REG_PACKAGE_IS_CONSTRUCTOR 0
diff --git a/test_backend.lua b/test_backend.lua
index c65eef6..c0b45a9 100644
--- a/test_backend.lua
+++ b/test_backend.lua
@@ -82,9 +82,9 @@ on_free = function()
end,
}
-local backend = git2.DatabaseBackend(cbs, 1)
+local backend = git2.DatabaseBackend(cbs, 0)
-print('add backend:', assert(db:add_backend(backend)))
+--print('add backend:', assert(db:add_backend(backend)))
print('create test blob:')
local raw_obj = git2.RawObject.new('blob',"any ol content will do")
@@ -112,7 +112,14 @@ end
local status, rep = pcall(git2.Repository.open_no_backend,
git_path, git_path .. 'objects', git_path .. 'index', git_path .. '../')
-print(status, rep)
+if not status then
+ print("Creating repository from git repository:", git_path)
+ rep = git2.Repository.open(git_path)
+else
+ print("Created repository with no backends from git repository:", git_path)
+end
+db = rep:database()
+print("add backend repository's database:", assert(db:add_backend(backend)))
print()
print("try reading objects from repository:")
@@ -126,7 +133,6 @@ for _,obj in ipairs(object_ids) do
local oid = git2.OID.str(obj[2])
local obj, err = rep:lookup(oid, obj[1])
print('read', obj, err)
- dump_rawobj(obj)
print()
end