summaryrefslogtreecommitdiff
path: root/git-cvsserver.perl
diff options
context:
space:
mode:
authorLars Noschinski <lars@public.noschinski.de>2008-07-17 17:00:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-19 18:17:43 (GMT)
commit89a9167fac209649116a6e1b7a39b4f4c974f86b (patch)
treecafa3a557a57fd3d486a6289aae1488549f87e99 /git-cvsserver.perl
parentb20171ebf7df3c31cce5cde3efaaf257b4ac2447 (diff)
downloadgit-89a9167fac209649116a6e1b7a39b4f4c974f86b.zip
git-89a9167fac209649116a6e1b7a39b4f4c974f86b.tar.gz
git-89a9167fac209649116a6e1b7a39b4f4c974f86b.tar.bz2
cvsserver: Add cvs co -c support
Implement cvs checkout's -c option by returning a list of all "modules". This is more useful than displaying a perl warning if -c is given. Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-cvsserver.perl')
-rwxr-xr-xgit-cvsserver.perl12
1 files changed, 12 insertions, 0 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 23b8ed3..b0a805c 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -801,6 +801,18 @@ sub req_co
argsplit("co");
+ # Provide list of modules, if -c was used.
+ if (exists $state->{opt}{c}) {
+ my $showref = `git show-ref --heads`;
+ for my $line (split '\n', $showref) {
+ if ( $line =~ m% refs/heads/(.*)$% ) {
+ print "M $1\t$1\n";
+ }
+ }
+ print "ok\n";
+ return 1;
+ }
+
my $module = $state->{args}[0];
$state->{module} = $module;
my $checkout_path = $module;