[JGIT PATCH 2/2] Add test for resolving "tag^{tree}" where "tag" points to a tag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jonas Fonseca <fonseca@xxxxxxx>
---
 .../spearce/jgit/test/resources/create-second-pack |    4 ++++
 ...ck-9c51502a527e1cc8ad4016629730bd1b90145dd6.idx |  Bin 0 -> 1100 bytes
 ...k-9c51502a527e1cc8ad4016629730bd1b90145dd6.pack |  Bin 0 -> 167 bytes
 .../org/spearce/jgit/test/resources/packed-refs    |    2 ++
 .../org/spearce/jgit/lib/RepositoryTestCase.java   |    1 +
 .../org/spearce/jgit/lib/T0008_testparserev.java   |    7 ++++++-
 6 files changed, 13 insertions(+), 1 deletions(-)
 create mode 100644 org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9c51502a527e1cc8ad4016629730bd1b90145dd6.idx
 create mode 100644 org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9c51502a527e1cc8ad4016629730bd1b90145dd6.pack

diff --git a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack
index 03f83dc..ea02240 100755
--- a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack
+++ b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/create-second-pack
@@ -130,6 +130,10 @@ git tag -a -m "An annotated tag" B a^
 
 git repack -d
 
+git tag -a -m "An annotated tag tagging a tag" C B
+
+git repack -d
+
 git pack-refs --all
 
 
diff --git a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9c51502a527e1cc8ad4016629730bd1b90145dd6.idx b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9c51502a527e1cc8ad4016629730bd1b90145dd6.idx
new file mode 100644
index 0000000000000000000000000000000000000000..8405f4c6ec64f8519e17e69702bc35950e128cb6
GIT binary patch
literal 1100
zcmexg;-AdGz`z8=qhK@yMq&ss0zEzA@xEr!YX5(!yhYthes*1{PO|3ZQBbm9xd9k9
wJXUTS*|zl0x>0Br=esNKxZcZ0w+|WWZnu)?y}XifT9^3ql@C8^Ry^GZ0BtNH4FCWD

literal 0
HcmV?d00001

diff --git a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9c51502a527e1cc8ad4016629730bd1b90145dd6.pack b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/pack-9c51502a527e1cc8ad4016629730bd1b90145dd6.pack
new file mode 100644
index 0000000000000000000000000000000000000000..14fa6c4d3abbd372b093f78dc43fe51fa19b7b70
GIT binary patch
literal 167
zcmV;Y09gM}K|@Ob000620005U33!|xj6n**Fc1LmdBuLfvfEU%0TGK|&<AYNB`P*4
zC4&Cm#={JAni8HGE0A*sMn>r^ah%wPAVcK9j_oiYX^(#I(3<*P6sjb%0hi{aD~xc1
z>%FXSl<wWtt<L(9d3k9U%X|VN>OEPq7Ix?mjTtjY&ZSD#sr?%1krT-O{sZeZEQmTr
Vu?Dn{n%HqRUQN1g$1dsO+rk;dPBs7l

literal 0
HcmV?d00001

diff --git a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/packed-refs b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/packed-refs
index f67a3ef..fc280c7 100644
--- a/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/packed-refs
+++ b/org.spearce.jgit.test/tst-rsrc/org/spearce/jgit/test/resources/packed-refs
@@ -9,5 +9,7 @@ d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864 refs/heads/pa
 6db9c2ebf75590eef973081736730a9ea169a0c4 refs/tags/A
 17768080a2318cd89bba4c8b87834401e2095703 refs/tags/B
 ^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864
+be83157b4ffe650d728ba4f98ad47b623b0d0c20 refs/tags/C
+^d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864
 8bbde7aacf771a9afb6992434f1ae413e010c6d8 refs/tags/spearce-gpg-pub
 ^fd608fbe625a2b456d9f15c2b1dc41f252057dd7
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
index 270b90a..b40d7b1 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/RepositoryTestCase.java
@@ -141,6 +141,7 @@ public void run() {
 				"pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f",
 				"pack-df2982f284bbabb6bdb59ee3fcc6eb0983e20371",
 				"pack-9fb5b411fe6dfa89cc2e6b89d2bd8e5de02b5745",
+				"pack-9c51502a527e1cc8ad4016629730bd1b90145dd6",
 				"pack-e6d07037cbcf13376308a0a995d1fa48f8f76aaa"
 		};
 		final File packDir = new File(db.getObjectsDirectory(), "pack");
diff --git a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0008_testparserev.java b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0008_testparserev.java
index 3457574..2a1a4ad 100644
--- a/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0008_testparserev.java
+++ b/org.spearce.jgit.test/tst/org/spearce/jgit/lib/T0008_testparserev.java
@@ -116,10 +116,15 @@ public void testDerefTagIssue23() throws IOException {
 		assertEquals("d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864",db.resolve("refs/tags/B^0").name());
 	}
 
+	public void testDerefTaggedTagTree() throws IOException {
+		assertEquals("269e1253bad5c247c6bde37aa48ae1e03138206c",db.resolve("refs/tags/C").name());
+		assertEquals("d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864",db.resolve("refs/tags/C^{commit}").name());
+		assertEquals("856ec208ae6cadac25a6d74f19b12bb27a24fe24",db.resolve("refs/tags/C^{tree}").name());
+	}
+
 	public void testDerefBlob() throws IOException {
 		assertEquals("fd608fbe625a2b456d9f15c2b1dc41f252057dd7",db.resolve("fd608fbe625a2b456d9f15c2b1dc41f252057dd7^{}").name());
 		assertEquals("fd608fbe625a2b456d9f15c2b1dc41f252057dd7",db.resolve("fd608fbe625a2b456d9f15c2b1dc41f252057dd7^{blob}").name());
 	}
 
-	// TODO: ^{tree} for a tag pointing to a tag
 }
-- 
1.6.0.336.ga07ba


-- 
Jonas Fonseca
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux