Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
cvsserver: Add support for packed refs
author
Lars Noschinski
<lars@public.noschinski.de>
Thu, 17 Jul 2008 17:00:27 +0000
(19:00 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Sat, 19 Jul 2008 18:17:43 +0000
(11:17 -0700)
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>
git-cvsserver.perl
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
374488f
)
diff --git
a/git-cvsserver.perl
b/git-cvsserver.perl
index e5ba57f3946cc5f38cd25bfd0b52ff6ac2209c5b..23b8ed398f7cb4588e5fe2613ded4514d46e8c84 100755
(executable)
--- 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 '') {
# 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";
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;
}
}