[PATCH] Add tests for handling corrupted caches

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

 



There might be a more straightforward way to generate an svn repository
with mergeinfo, but I'm not very familiar with svn.

Signed-off-by: Jason Gross <jgross@xxxxxxx>
---
 t/t9160-git-svn-caches.sh |   59 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 59 insertions(+), 0 deletions(-)
 create mode 100755 t/t9160-git-svn-caches.sh

diff --git a/t/t9160-git-svn-caches.sh b/t/t9160-git-svn-caches.sh
new file mode 100755
index 0000000..bba437a
--- /dev/null
+++ b/t/t9160-git-svn-caches.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+
+test_description='git svn handling of .git/svn/.caches'
+
+. ./lib-git-svn.sh
+
+say 'define NO_SVN_TESTS to skip git svn tests'
+
+test_expect_success 'initialize source svn repo' '
+	svn_cmd mkdir -m x "$svnrepo"/trunk "$svnrepo"/branches &&
+	svn_cmd co "$svnrepo" "$SVN_TREE"
+'
+
+test_expect_success 'make a change that gives mergeinfo' '
+	(
+		cd "$SVN_TREE" &&
+		touch trunk/foo &&
+		svn_cmd add trunk/foo &&
+		svn_cmd commit -m "foo" &&
+		svn_cmd up &&
+		svn_cmd cp trunk branches/1
+		svn_cmd commit -m "make branch" &&
+		svn_cmd up &&
+		touch branches/1/bar &&
+		svn_cmd add branches/1/bar &&
+		svn_cmd commit -m bar &&
+		svn_cmd up &&
+		cd trunk &&
+		svn_cmd merge ../branches/1 &&
+		svn_cmd commit -m merge &&
+		svn_cmd up
+	)
+'
+
+test_expect_success 'clone svn repo and corrupt .caches' '
+	git svn init "$svnrepo" -T trunk -b branches &&
+	git svn fetch &&
+	echo corrupted > .git/svn/.caches/lookup_svn_merge.db
+'
+
+test_expect_success 'make another change that generates mergeinfo' '
+	(
+		cd "$SVN_TREE" &&
+		touch branches/1/baz &&
+		svn_cmd commit -m baz &&
+		svn_cmd up &&
+		cd trunk &&
+		svn_cmd merge ../branches/1 &&
+		svn_cmd commit -m merge2 &&
+		svn_cmd up
+	) &&
+	rm -rf "$SVN_TREE"
+'
+
+test_expect_success 'fetch change with mergeinfo with a corrupted cache' '
+	git svn fetch
+'
+
+test_done
-- 
1.7.6.558.g4b2f

--
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]