diff options
Diffstat (limited to 'pre-commit.d/30store-metadata')
-rwxr-xr-x | pre-commit.d/30store-metadata | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pre-commit.d/30store-metadata b/pre-commit.d/30store-metadata index 455429a..d445db1 100755 --- a/pre-commit.d/30store-metadata +++ b/pre-commit.d/30store-metadata @@ -81,14 +81,16 @@ generate_metadata() { if (exists $uidcache{$want}) { return $uidcache{$want}; } - return $uidcache{$want}=scalar getpwuid($want); + my $name=scalar getpwuid($want); + return $uidcache{$want}=defined $name ? $name : $want; } sub gidname { my $want=shift; if (exists $gidcache{$want}) { return $gidcache{$want}; } - return $gidcache{$want}=scalar getgrgid($want); + my $name=scalar getgrgid($want); + return $gidcache{$want}=defined $name ? $name : $want; } chomp; my @stat=stat($_); |