From 1a89f13220d5832e7677362d7933f2fc96ab0f9d Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 15 Sep 2020 17:46:37 +0100 Subject: tests: Verify that working repos for cvs and svn mirroring are bare These will currently fail: * gitify_cvs creates non-bare repositories * gitify_svn creates non-bare repositories and changes them to bare, but leaves ref-logs enabled Related to #12. --- tests/cvs-single-commit.script | 12 +++++++++++- tests/cvs-single-commit.stdout | 21 +++++++++++++++++++++ tests/svn-single-commit.script | 13 ++++++++++++- tests/svn-single-commit.stdout | 31 +++++++++++++++++++++++++++++++ 4 files changed, 75 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/cvs-single-commit.script b/tests/cvs-single-commit.script index 728cc8b..a0639ba 100755 --- a/tests/cvs-single-commit.script +++ b/tests/cvs-single-commit.script @@ -2,7 +2,7 @@ # # Tests converting a simple CVS repository to git. # -# Copyright (C) 2012 Codethink Limited +# Copyright (C) 2012, 2020 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,6 +23,14 @@ set -e logfile="$DATADIR/cvs-test-repo.log" workdir="$DATADIR/work-dir" +normalize() { + sed -r -e '/hooks\/.*\.sample/d' \ + -e "s/pack-[0-9a-z]+\.(idx|pack)$/pack-file/" \ + -e "/\/objects\/info\/commit-graph$/d" \ + -e "/\/objects\/pack\/pack-[0-9a-z]+\.bitmap$/d" \ + -e "s|$DATADIR|DATADIR|g" "$@" +} + # CVS wants $USER, $LOGNAME, and $LOGNAME set to a real username. export USER=root export LOGNAME=$USER @@ -44,3 +52,5 @@ export USERNAME=$USER echo "commit messages:" git log --pretty='%s' master ) + +find "$workdir/cvs-test-repo" | LC_ALL=C sort | normalize diff --git a/tests/cvs-single-commit.stdout b/tests/cvs-single-commit.stdout index 91f58b0..6938eda 100644 --- a/tests/cvs-single-commit.stdout +++ b/tests/cvs-single-commit.stdout @@ -6,3 +6,24 @@ first line commit messages: first commit initial checkin +DATADIR/work-dir/cvs-test-repo +DATADIR/work-dir/cvs-test-repo/git-a +DATADIR/work-dir/cvs-test-repo/git-a/HEAD +DATADIR/work-dir/cvs-test-repo/git-a/branches +DATADIR/work-dir/cvs-test-repo/git-a/config +DATADIR/work-dir/cvs-test-repo/git-a/description +DATADIR/work-dir/cvs-test-repo/git-a/hooks +DATADIR/work-dir/cvs-test-repo/git-a/info +DATADIR/work-dir/cvs-test-repo/git-a/info/exclude +DATADIR/work-dir/cvs-test-repo/git-a/info/refs +DATADIR/work-dir/cvs-test-repo/git-a/lorry-update-count +DATADIR/work-dir/cvs-test-repo/git-a/objects +DATADIR/work-dir/cvs-test-repo/git-a/objects/info +DATADIR/work-dir/cvs-test-repo/git-a/objects/info/packs +DATADIR/work-dir/cvs-test-repo/git-a/objects/pack +DATADIR/work-dir/cvs-test-repo/git-a/objects/pack/pack-file +DATADIR/work-dir/cvs-test-repo/git-a/objects/pack/pack-file +DATADIR/work-dir/cvs-test-repo/git-a/packed-refs +DATADIR/work-dir/cvs-test-repo/git-a/refs +DATADIR/work-dir/cvs-test-repo/git-a/refs/heads +DATADIR/work-dir/cvs-test-repo/git-a/refs/tags diff --git a/tests/svn-single-commit.script b/tests/svn-single-commit.script index 533f1dc..7ae2eb9 100755 --- a/tests/svn-single-commit.script +++ b/tests/svn-single-commit.script @@ -2,7 +2,7 @@ # # Tests converting a simple SVN repository to git. # -# Copyright (C) 2012 Codethink Limited +# Copyright (C) 2012, 2020 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,6 +23,15 @@ set -e logfile="$DATADIR/svn-test-repo.log" workdir="$DATADIR/work-dir" +normalize() { + sed -r -e '/hooks\/.*\.sample/d' \ + -e "s/pack-[0-9a-z]+\.(idx|pack)$/pack-file/" \ + -e "/\/objects\/info\/commit-graph$/d" \ + -e "/\/objects\/pack\/pack-[0-9a-z]+\.bitmap$/d" \ + -e "s/\b[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}\b/UUID/" \ + -e "s|$DATADIR|DATADIR|g" "$@" +} + "${SRCDIR}/test-lorry" --pull-only --log="$logfile" --working-area="$workdir" \ "$DATADIR/svn-test-repo.lorry" > /dev/null 2> /dev/null @@ -39,3 +48,5 @@ workdir="$DATADIR/work-dir" # list the commit messages git log --pretty='%s' master ) + +find "$workdir/svn-test-repo" | LC_ALL=C sort | normalize diff --git a/tests/svn-single-commit.stdout b/tests/svn-single-commit.stdout index eae50d1..8cb2926 100644 --- a/tests/svn-single-commit.stdout +++ b/tests/svn-single-commit.stdout @@ -1,3 +1,34 @@ refs/heads/master first line first commit +DATADIR/work-dir/svn-test-repo +DATADIR/work-dir/svn-test-repo/git-a +DATADIR/work-dir/svn-test-repo/git-a/HEAD +DATADIR/work-dir/svn-test-repo/git-a/branches +DATADIR/work-dir/svn-test-repo/git-a/config +DATADIR/work-dir/svn-test-repo/git-a/description +DATADIR/work-dir/svn-test-repo/git-a/hooks +DATADIR/work-dir/svn-test-repo/git-a/info +DATADIR/work-dir/svn-test-repo/git-a/info/exclude +DATADIR/work-dir/svn-test-repo/git-a/info/refs +DATADIR/work-dir/svn-test-repo/git-a/lorry-update-count +DATADIR/work-dir/svn-test-repo/git-a/objects +DATADIR/work-dir/svn-test-repo/git-a/objects/info +DATADIR/work-dir/svn-test-repo/git-a/objects/info/packs +DATADIR/work-dir/svn-test-repo/git-a/objects/pack +DATADIR/work-dir/svn-test-repo/git-a/objects/pack/pack-file +DATADIR/work-dir/svn-test-repo/git-a/objects/pack/pack-file +DATADIR/work-dir/svn-test-repo/git-a/packed-refs +DATADIR/work-dir/svn-test-repo/git-a/refs +DATADIR/work-dir/svn-test-repo/git-a/refs/heads +DATADIR/work-dir/svn-test-repo/git-a/refs/tags +DATADIR/work-dir/svn-test-repo/git-a/svn +DATADIR/work-dir/svn-test-repo/git-a/svn/.metadata +DATADIR/work-dir/svn-test-repo/git-a/svn/refs +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master/.rev_map.UUID +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master/index +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/heads/master/unhandled.log +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/remotes +DATADIR/work-dir/svn-test-repo/git-a/svn/refs/remotes/git-svn -- cgit v1.2.1