diff options
author | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-09-17 00:07:33 +0100 |
---|---|---|
committer | Ben Hutchings <ben.hutchings@codethink.co.uk> | 2020-09-17 02:50:26 +0100 |
commit | 2468e2b22c400343d665bba3ea8554fef024affc (patch) | |
tree | 114e1649dc53d073fe5044c5c5f79ab42448f56b | |
parent | 37f629385d9acb49061700932c237c038433a2e3 (diff) | |
download | lorry-2468e2b22c400343d665bba3ea8554fef024affc.tar.gz |
lorry: Make cvsps store cache inside working git repository
git cvsimport uses cvsps, which creates state files under ~/.cvsps.
This means the cache may become inconsistent with the git repository.
I observed this to happen when adding a second test case for cvs
conversion.
Set $HOME to the git directory so that this doesn't happen.
-rwxr-xr-x | lorry | 1 | ||||
-rwxr-xr-x | tests/cvs-single-commit.script | 1 | ||||
-rw-r--r-- | tests/cvs-single-commit.stdout | 1 |
3 files changed, 3 insertions, 0 deletions
@@ -680,6 +680,7 @@ class Lorry(cliapp.Application): env = dict(os.environ) env['CVS_RSH'] = 'lorry-ssh-wrapper' env['GIT_DIR'] = gitdir + env['HOME'] = gitdir # make cvsps store cache under git dir self.run_program( ['git', 'cvsimport', '-a', '-d', spec['url'], '-i', spec['module']], diff --git a/tests/cvs-single-commit.script b/tests/cvs-single-commit.script index f7d551d..ba31111 100755 --- a/tests/cvs-single-commit.script +++ b/tests/cvs-single-commit.script @@ -28,6 +28,7 @@ normalize() { -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 "/\/\.cvsps\//d" \ -e "s|$DATADIR|DATADIR|g" "$@" } diff --git a/tests/cvs-single-commit.stdout b/tests/cvs-single-commit.stdout index 6938eda..1a14972 100644 --- a/tests/cvs-single-commit.stdout +++ b/tests/cvs-single-commit.stdout @@ -8,6 +8,7 @@ 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/.cvsps 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 |