summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5dd5ed0)
raw | patch | inline | side by side (parent: 5dd5ed0)
author | Junio C Hamano <junkio@cox.net> | |
Wed, 8 Nov 2006 06:37:17 +0000 (22:37 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 8 Nov 2006 06:42:05 +0000 (22:42 -0800) |
A forked project is defined to be $projname/$forkname.git for
$projname.git; the code did not check this correctly and mistook
$projname/.git to be a fork of itself. This minimally fixes the
breakage.
Also forks were not checked when index.aux file was in use.
Listing the forked ones in index.aux would show them also on the
toplevel index which may go against the hierarchical nature of
forks, but again this is a minimal fix to whip it in a better
shape suitable to be in the 'master' branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
$projname.git; the code did not check this correctly and mistook
$projname/.git to be a fork of itself. This minimally fixes the
breakage.
Also forks were not checked when index.aux file was in use.
Listing the forked ones in index.aux would show them also on the
toplevel index which may go against the hierarchical nature of
forks, but again this is a minimal fix to whip it in a better
shape suitable to be in the 'master' branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
gitweb/gitweb.perl | patch | blob | history |
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 680832c986aa30f796466dd66f673ddd7ecfa553..c46629f822a972a9573e6b3eabeffaef548f2eef 100755 (executable)
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
if (!defined $path) {
next;
}
+ if ($filter ne '') {
+ # looking for forks;
+ my $pfx = substr($path, 0, length($filter));
+ if ($pfx ne $filter) {
+ next;
+ }
+ my $sfx = substr($path, length($filter));
+ if ($sfx !~ /^\/.*\.git$/) {
+ next;
+ }
+ }
if (check_export_ok("$projectroot/$path")) {
my $pr = {
path => $path,
}
if ($check_forks) {
my $pname = $pr->{'path'};
- $pname =~ s/\.git$//;
- $pr->{'forks'} = -d "$projectroot/$pname";
+ if (($pname =~ s/\.git$//) &&
+ ($pname !~ /\/$/) &&
+ (-d "$projectroot/$pname")) {
+ $pr->{'forks'} = "-d $projectroot/$pname";
+ }
+ else {
+ $pr->{'forks'} = 0;
+ }
}
push @projects, $pr;
}
if ($check_forks) {
print "<td>";
if ($pr->{'forks'}) {
+ print "<!-- $pr->{'forks'} -->\n";
print $cgi->a({-href => href(project=>$pr->{'path'}, action=>"forks")}, "+");
}
print "</td>\n";