Do not use GUID on dir in git init --shared=all on FreeBSD

It does not allow changing the bit to a non-root user.
This fixes t1301-shared-repo.sh on the platform.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Alex Riesen
2008-03-05 00:15:39 +01:00
committed by Junio C Hamano
parent ce2cf27adc
commit 81a24b52c1
3 changed files with 11 additions and 1 deletions

2
path.c
View File

@ -283,7 +283,7 @@ int adjust_shared_perm(const char *path)
? (S_IXGRP|S_IXOTH)
: 0));
if (S_ISDIR(mode))
mode |= S_ISGID;
mode |= FORCE_DIR_SET_GID;
if ((mode & st.st_mode) != mode && chmod(path, mode) < 0)
return -2;
return 0;