# [PATCH] Adjust reflog filemode in shared repository

2 messages from 2007-03-09 to 2007-03-10. Participants: Matthias Kestenholz, Junio C Hamano.
Thread: https://gitlist.dev/t/7168

## Matthias Kestenholz, 2007-03-09 22:38

Subject: [PATCH] Adjust reflog filemode in shared repository
Message-ID: <11734799371637-git-send-email-matthias@spinlock.ch>
URL: https://gitlist.dev/e/11734799371637-git-send-email-matthias%40spinlock.ch

```
Without this, committing in a group-shared repository would not work
even though all developers are in the same group.

Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
 refs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/refs.c b/refs.c
index 76c08d0..9f1fb68 100644
--- a/refs.c
+++ b/refs.c
@@ -921,6 +921,8 @@ static int log_ref_write(const char *ref_name, const unsigned char *old_sha1,
 				     log_file, strerror(errno));
 	}
 
+	adjust_shared_perm(log_file);
+
 	msglen = 0;
 	if (msg) {
 		/* clean up the message and make sure it is a single line */
-- 
1.5.0.3.942.g299f-dirty

```

## Junio C Hamano, 2007-03-10 00:53

Subject: Re: [PATCH] Adjust reflog filemode in shared repository
Message-ID: <7vd53h3om9.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vd53h3om9.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <11734799371637-git-send-email-matthias@spinlock.ch>

```
Thanks, will apply to 'maint' to be included in v1.5.0.4 (and
also in 'master' to be in v1.5.1).

We should add tests whenever we found this kind of breakage.
For core.sharedrepository, we would want to have something like
this:

 (1) Initialize a repository
 (2) set core.sharedrepository
 (3) set umask to 077
 (4) perform various git operations in the repository
 (5) "find .git" to see if there is anything unreadable by group
     members; if you find any, you found a bug.

That is the "feature" test -- check if a feature works as
intended.

At the same time, we need to have a corresponding "regression"
test to make sure that a feature does not overstep its boundary
and affect cases where it is not enabled:

 (1) Initialize a repository
 (2) unset core.sharedrepository
 (3) set umask to 077
 (4) perform various git operations in the repository
 (5) "find .git" to see if there is anything readable by group
     members; if you find any, you found a bug.

We would need such "regression" tests for existing tests too,
but that is a separate issue.

```
