summaryrefslogtreecommitdiff
path: root/t/t9200-git-cvsexportcommit.sh
diff options
context:
space:
mode:
authorNick Woolley <nickwoolley@yahoo.co.uk>2009-05-28 23:23:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-05-29 06:51:03 (GMT)
commit54d5cc0e126ed4b6cc4b186efd9faf7b93df570f (patch)
treef3ae07ac96daa048e6ae2bd65f7873431af9cf2d /t/t9200-git-cvsexportcommit.sh
parente57cb0158209ece040a4b873064504efd7d2ec0e (diff)
downloadgit-54d5cc0e126ed4b6cc4b186efd9faf7b93df570f.zip
git-54d5cc0e126ed4b6cc4b186efd9faf7b93df570f.tar.gz
git-54d5cc0e126ed4b6cc4b186efd9faf7b93df570f.tar.bz2
git-cvsexportcommit can't commit files which have been removed from CVS
If a file X is removed from CVS, it goes into the Attic directory, and CVS reports it as 'no file X' but with status 'Up-to-date'. cvsexportcommit misinterprets this as an existing file and tries to commit a file with the same name. Correctly identify these files, so that new files with the same name can be committed. Add a test to t9200-git-cvsexportcommit.sh, which tests that we can re-commit a removed filename which remains in CVS's attic. This adds a file 'attic_gremlin' in CVS, then "removes" it, then tries to commit a file with the same name from git. Signed-off-by: Nick Woolley <git.wu-lee@noodlefactory.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9200-git-cvsexportcommit.sh')
-rwxr-xr-xt/t9200-git-cvsexportcommit.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t9200-git-cvsexportcommit.sh b/t/t9200-git-cvsexportcommit.sh
index 56b7c06..ef1f8d2 100755
--- a/t/t9200-git-cvsexportcommit.sh
+++ b/t/t9200-git-cvsexportcommit.sh
@@ -317,4 +317,22 @@ test_expect_success 'use the same checkout for Git and CVS' '
'
+test_expect_success 're-commit a removed filename which remains in CVS attic' '
+
+ (cd "$CVSWORK" &&
+ echo >attic_gremlin &&
+ cvs -Q add attic_gremlin &&
+ cvs -Q ci -m "added attic_gremlin" &&
+ rm attic_gremlin &&
+ cvs -Q rm attic_gremlin &&
+ cvs -Q ci -m "removed attic_gremlin") &&
+
+ echo > attic_gremlin &&
+ git add attic_gremlin &&
+ git commit -m "Added attic_gremlin" &&
+ git cvsexportcommit -w "$CVSWORK" -c HEAD &&
+ (cd "$CVSWORK"; cvs -Q update -d) &&
+ test -f "$CVSWORK/attic_gremlin"
+'
+
test_done