NetBSD shares semantics with FreeBSD and OpenBSD, at least;
and presumably all their *BSD cousins behave the same way.
my $all_mask = 07777;
my $dir_mask = 02770;
-# FreeBSD and apparently OpenBSD does not allow non-root users to set S_ISGID,
+# FreeBSD, OpenBSD and NetBSD do not allow non-root users to set S_ISGID,
# so git doesn't set it, either (see DIR_HAS_BSD_GROUP_SEMANTICS in git.git)
-if ($^O =~ /(?:free|open)bsd/i) {
+# Presumably all *BSDs behave the same way.
+if ($^O =~ /\A.+bsd\z/i) {
$all_mask = 0777;
$dir_mask = 0770;
}