Skip to content

Commit 336d09d

Browse files
MadCodergitster
authored andcommitted
Make git reflog expire honour core.sharedRepository.
Signed-off-by: Pierre Habouzit <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4744d72 commit 336d09d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

builtin-reflog.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,8 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
307307
unlink(newlog_path);
308308
} else if (cmd->updateref && commit_ref(lock)) {
309309
status |= error("Couldn't set %s", lock->ref_name);
310+
} else {
311+
adjust_shared_perm(log_file);
310312
}
311313
}
312314
free(newlog_path);

t/t1301-shared-repo.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,19 @@ do
8383

8484
done
8585

86+
test_expect_success 'git reflog expire honors core.sharedRepository' '
87+
git config core.sharedRepository group &&
88+
git reflog expire --all &&
89+
actual="$(ls -l .git/logs/refs/heads/master)" &&
90+
case "$actual" in
91+
-rw-rw-*)
92+
: happy
93+
;;
94+
*)
95+
echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual]
96+
false
97+
;;
98+
esac
99+
'
100+
86101
test_done

0 commit comments

Comments
 (0)