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>
Lars Noschinski committed
Jul 17, 2008 at 19:00 UTC
89a9167fac209649116a6e1b7a39b4f4c974f86b
1 file changed
+12
git-cvsserver.perl
+12
@@ -801,6 +801,18 @@ sub req_co
801
802
argsplit("co");
803
804
+ # Provide list of modules, if -c was used.
805
+ if (exists $state->{opt}{c}) {
806
+ my $showref = `git show-ref --heads`;
807
+ for my $line (split '\n', $showref) {
808
+ if ( $line =~ m% refs/heads/(.*)$% ) {
809
+ print "M $1\t$1\n";
810
+ }
811
+ }
812
+ print "ok\n";
813
+ return 1;
814
+ }
815
+
816
my $module = $state->{args}[0];
817
$state->{module} = $module;
818
my $checkout_path = $module;