summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Noschinski <lars@public.noschinski.de>2008-07-17 19:00:27 +0200
committerJunio C Hamano <gitster@pobox.com>2008-07-19 11:17:43 -0700
commitb20171ebf7df3c31cce5cde3efaaf257b4ac2447 (patch)
tree4ed528b762f05f0d9f668c13196132463f1aa592
parent374488f31d70e6f009abf533a1c0a8077301f18d (diff)
downloadgit-b20171ebf7df3c31cce5cde3efaaf257b4ac2447.tar.gz
cvsserver: Add support for packed refs
req_update still parses /refs/heads manually. Replace this by a call to show-ref. Signed-off-by: Lars Noschinski <lars@public.noschinski.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-cvsserver.perl22
1 files changed, 8 insertions, 14 deletions
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index e5ba57f394..23b8ed398f 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -947,21 +947,15 @@ sub req_update
# projects (heads in this case) to checkout.
#
if ($state->{module} eq '') {
- my $heads_dir = $state->{CVSROOT} . '/refs/heads';
- if (!opendir HEADS, $heads_dir) {
- print "E [server aborted]: Failed to open directory, "
- . "$heads_dir: $!\nerror\n";
- return 0;
- }
+ my $showref = `git show-ref --heads`;
print "E cvs update: Updating .\n";
- while (my $head = readdir(HEADS)) {
- if (-f $state->{CVSROOT} . '/refs/heads/' . $head) {
- print "E cvs update: New directory `$head'\n";
- }
- }
- closedir HEADS;
- print "ok\n";
- return 1;
+ for my $line (split '\n', $showref) {
+ if ( $line =~ m% refs/heads/(.*)$% ) {
+ print "E cvs update: New directory `$1'\n";
+ }
+ }
+ print "ok\n";
+ return 1;
}