- my $descr = git_read_description($proj) || "";
- my $owner = "";
- my ($dev, $ino, $mode, $nlink, $st_uid, $st_gid, $rdev, $size) = stat("$projectroot/$proj");
- my ($name, $passwd, $uid, $gid, $quota, $comment, $gcos, $dir, $shell) = getpwuid($st_uid);
- if (defined $gcos) {
- $owner = $gcos;
- $owner =~ s/[,;].*$//;
+ my $descr = git_read_description($proj{'path'}) || "";
+ # get directory owner if not already specified
+ if (!defined $proj{'owner'}) {
+ $proj{'owner'} = get_file_owner("$projectroot/$proj{'path'}") || "";