summaryrefslogtreecommitdiff
path: root/tests/resources
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-04-12 13:32:27 +0100
committerPatrick Steinhardt <ps@pks.im>2018-04-12 13:45:53 +0100
commit54fd80e3f8d7850576c60fa8baf7269df3c9e6a3 (patch)
tree069a77dcc81a2568e5c06b227a46c0c08f08c1d4 /tests/resources
parent0eca42304a10c9ad6170a38a440dfab8e354d38d (diff)
downloadlibgit2-54fd80e3f8d7850576c60fa8baf7269df3c9e6a3.tar.gz
revwalk: fix uninteresting revs sometimes not limiting graphwalk
When we want to limit our graphwalk, we use the heuristic of checking whether the newest limiting (uninteresting) revision is newer than the oldest interesting revision. We do so by inspecting whether the first item's commit time of the user-supplied list of revisions is newer than the last added interesting revision. This is wrong though, as the user supplied list is in no way guaranteed to be sorted by increasing commit dates. This could lead us to abort the revwalk early before applying all relevant limiting revisions, outputting revisions which should in fact have been hidden. Fix the heuristic by instead checking whether _any_ of the limiting commits was made earlier than the last interesting commit. Add a test.
Diffstat (limited to 'tests/resources')
-rw-r--r--tests/resources/revwalk.git/HEAD1
-rw-r--r--tests/resources/revwalk.git/config6
-rw-r--r--tests/resources/revwalk.git/description1
-rw-r--r--tests/resources/revwalk.git/objects/info/packs2
-rw-r--r--tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.idxbin0 -> 1520 bytes
-rw-r--r--tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.packbin0 -> 1862 bytes
-rw-r--r--tests/resources/revwalk.git/packed-refs7
-rw-r--r--tests/resources/revwalk.git/refs/.gitkeep0
8 files changed, 17 insertions, 0 deletions
diff --git a/tests/resources/revwalk.git/HEAD b/tests/resources/revwalk.git/HEAD
new file mode 100644
index 000000000..cb089cd89
--- /dev/null
+++ b/tests/resources/revwalk.git/HEAD
@@ -0,0 +1 @@
+ref: refs/heads/master
diff --git a/tests/resources/revwalk.git/config b/tests/resources/revwalk.git/config
new file mode 100644
index 000000000..7c968c3b5
--- /dev/null
+++ b/tests/resources/revwalk.git/config
@@ -0,0 +1,6 @@
+[core]
+ bare = true
+ repositoryformatversion = 0
+ filemode = false
+ symlinks = false
+ ignorecase = true
diff --git a/tests/resources/revwalk.git/description b/tests/resources/revwalk.git/description
new file mode 100644
index 000000000..498b267a8
--- /dev/null
+++ b/tests/resources/revwalk.git/description
@@ -0,0 +1 @@
+Unnamed repository; edit this file 'description' to name the repository.
diff --git a/tests/resources/revwalk.git/objects/info/packs b/tests/resources/revwalk.git/objects/info/packs
new file mode 100644
index 000000000..d8d85b895
--- /dev/null
+++ b/tests/resources/revwalk.git/objects/info/packs
@@ -0,0 +1,2 @@
+P pack-9adacb9971981a1a3264fd473da5b800f2715959.pack
+
diff --git a/tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.idx b/tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.idx
new file mode 100644
index 000000000..e157b386e
--- /dev/null
+++ b/tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.idx
Binary files differ
diff --git a/tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.pack b/tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.pack
new file mode 100644
index 000000000..2a61f9403
--- /dev/null
+++ b/tests/resources/revwalk.git/objects/pack/pack-9adacb9971981a1a3264fd473da5b800f2715959.pack
Binary files differ
diff --git a/tests/resources/revwalk.git/packed-refs b/tests/resources/revwalk.git/packed-refs
new file mode 100644
index 000000000..905a3db51
--- /dev/null
+++ b/tests/resources/revwalk.git/packed-refs
@@ -0,0 +1,7 @@
+# pack-refs with: peeled fully-peeled sorted
+3ae0f53011bdb7e68f99bde4943449f36c1c318a refs/heads/A
+061978578d7c9ff2ba92dd36d31fd8d809871030 refs/heads/B
+743398b425d6c216d6cfaae3786b5bc436393ae5 refs/heads/C
+790ba0facf6fd103699a5c40cd19dad277ff49cd refs/heads/D
+d3d783066cf7d95def6844b9c5118c1e7bcce7df refs/heads/E
+d3d783066cf7d95def6844b9c5118c1e7bcce7df refs/heads/master
diff --git a/tests/resources/revwalk.git/refs/.gitkeep b/tests/resources/revwalk.git/refs/.gitkeep
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/resources/revwalk.git/refs/.gitkeep