summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-05-29 14:05:28 +0100
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2014-05-29 14:05:38 +0100
commitd6490495f37e1ae503a2357c74077f4be720b258 (patch)
tree3bf5a4f71fbbeaebb8a721d2daa3b070376f1724
parent09c1dbe8ed459b16201b7d6c7408da544d6c711c (diff)
downloadgall-d6490495f37e1ae503a2357c74077f4be720b258.tar.gz
Demonstrate the issue
-rw-r--r--test/create_test_repo.sh1
-rw-r--r--test/lorries-broken.tarbin0 -> 81920 bytes
-rw-r--r--test/test-gall.repository.lua8
-rw-r--r--test/withrepo.lua9
4 files changed, 15 insertions, 3 deletions
diff --git a/test/create_test_repo.sh b/test/create_test_repo.sh
index 7eedefa..8e01b4d 100644
--- a/test/create_test_repo.sh
+++ b/test/create_test_repo.sh
@@ -3,3 +3,4 @@
cd test
tar xf test_repo.tar
+tar xf lorries-broken.tar
diff --git a/test/lorries-broken.tar b/test/lorries-broken.tar
new file mode 100644
index 0000000..074d1cf
--- /dev/null
+++ b/test/lorries-broken.tar
Binary files differ
diff --git a/test/test-gall.repository.lua b/test/test-gall.repository.lua
index f945864..0f59993 100644
--- a/test/test-gall.repository.lua
+++ b/test/test-gall.repository.lua
@@ -222,6 +222,14 @@ function suite.merge_base_annotated_tags()
assert(repo:merge_base(sha_1, sha_2) == sha_b)
end
+function suite.merge_base_lorries_regression()
+ local repo = test_repo("lorries.git")
+ local sha_1 = "738022ab867407fc9e906e89268043f72179730a"
+ local sha_2 = "2f0995c6c852c9b9d6ce584f3b9f38a981a40cf3"
+ local sha_b = "738022ab867407fc9e906e89268043f72179730a"
+ assert(repo:merge_base(sha_1, sha_2) == sha_b)
+end
+
function suite.rev_list()
local repo = test_repo()
local sha_new = "0b65c32b6a5277ff0e75ddad9e3914148914042d"
diff --git a/test/withrepo.lua b/test/withrepo.lua
index bf90b0c..0795993 100644
--- a/test/withrepo.lua
+++ b/test/withrepo.lua
@@ -7,12 +7,15 @@ local _xpcall = xpcall
function xpcall(fn, tb)
os.execute("rm -rf test/test_repo")
+ os.execute("rm -rf test/lorries.git")
local ok, msg = _xpcall(fn, tb)
os.execute("rm -rf test/test_repo")
+ os.execute("rm -rf test/lorries.git")
return ok, msg
end
-function test_repo()
+function test_repo(reponame)
+ reponame = reponame or "test_repo"
os.execute("sh test/create_test_repo.sh")
- return assert(require("gall.repository").new "test/test_repo")
-end \ No newline at end of file
+ return assert(require("gall.repository").new("test/" .. reponame))
+end