cvsserver: Fix for work trees
authorBrian Downing <[email protected]>
Thu, 9 Aug 2007 04:26:10 +0000 (8 23:26 -0500)
committerJunio C Hamano <[email protected]>
Thu, 9 Aug 2007 05:16:46 +0000 (8 22:16 -0700)
git-cvsserver used checkout-index internally for commit and annotate.
Since a work tree is required for this to function now, this was
breaking.  Work around this by defining GIT_WORK_TREE=. in the
appropriate places.

Signed-off-by: Brian Downing <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
git-cvsserver.perl

index ae7d511..13dbd27 100755 (executable)
@@ -1196,6 +1196,7 @@ sub req_ci
     $log->info("Lockless commit start, basing commit on '$tmpdir', index file is '$file_index'");
 
     $ENV{GIT_DIR} = $state->{CVSROOT} . "/";
+    $ENV{GIT_WORK_TREE} = ".";
     $ENV{GIT_INDEX_FILE} = $file_index;
 
     # Remember where the head was at the beginning.
@@ -1721,6 +1722,7 @@ sub req_annotate
     $log->info("Temp checkoutdir creation successful, basing annotate session work on '$tmpdir', index file is '$file_index'");
 
     $ENV{GIT_DIR} = $state->{CVSROOT} . "/";
+    $ENV{GIT_WORK_TREE} = ".";
     $ENV{GIT_INDEX_FILE} = $file_index;
 
     chdir $tmpdir;