diff options
author | Jakub Narebski <jnareb@gmail.com> | 2006-10-28 19:43:40 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-10-28 14:26:00 -0700 |
commit | c60c56cc70dbf2acb4d15e3ea4f95d09020acc82 (patch) | |
tree | e19241faec7a7420423cd983fb4db4ac769af639 /gitweb | |
parent | 1dc5e55f2d2cab9ca24dc435dc2bc4f466f15ade (diff) | |
download | git-c60c56cc70dbf2acb4d15e3ea4f95d09020acc82.tar.gz git-c60c56cc70dbf2acb4d15e3ea4f95d09020acc82.tar.xz |
gitweb: Move git_get_last_activity subroutine earlier
This is purely cosmetic. Having git_get_* between two parse_* subroutines
violated a good convention to group related things together.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 7b2499af1..6714e4187 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -976,6 +976,24 @@ sub git_get_project_owner { return $owner; } +sub git_get_last_activity { + my ($path) = @_; + my $fd; + + $git_dir = "$projectroot/$path"; + open($fd, "-|", git_cmd(), 'for-each-ref', + '--format=%(refname) %(committer)', + '--sort=-committerdate', + 'refs/heads') or return; + my $most_recent = <$fd>; + close $fd or return; + if ($most_recent =~ / (\d+) [-+][01]\d\d\d$/) { + my $timestamp = $1; + my $age = time - $timestamp; + return ($age, age_string($age)); + } +} + sub git_get_references { my $type = shift || ""; my %refs; @@ -1082,24 +1100,6 @@ sub parse_tag { return %tag } -sub git_get_last_activity { - my ($path) = @_; - my $fd; - - $git_dir = "$projectroot/$path"; - open($fd, "-|", git_cmd(), 'for-each-ref', - '--format=%(refname) %(committer)', - '--sort=-committerdate', - 'refs/heads') or return; - my $most_recent = <$fd>; - close $fd or return; - if ($most_recent =~ / (\d+) [-+][01]\d\d\d$/) { - my $timestamp = $1; - my $age = time - $timestamp; - return ($age, age_string($age)); - } -} - sub parse_commit { my $commit_id = shift; my $commit_text = shift; |