From 336d09daf288492946f0c51f071da11643f8363d Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Sun, 15 Jun 2008 23:37:42 +0200 Subject: [PATCH] Make git reflog expire honour core.sharedRepository. Signed-off-by: Pierre Habouzit Signed-off-by: Junio C Hamano --- builtin-reflog.c | 2 ++ t/t1301-shared-repo.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/builtin-reflog.c b/builtin-reflog.c index 897d1dcac..b151e24ff 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -307,6 +307,8 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused, unlink(newlog_path); } else if (cmd->updateref && commit_ref(lock)) { status |= error("Couldn't set %s", lock->ref_name); + } else { + adjust_shared_perm(log_file); } } free(newlog_path); diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh index 5e4252a32..6c78c8bc9 100755 --- a/t/t1301-shared-repo.sh +++ b/t/t1301-shared-repo.sh @@ -83,4 +83,19 @@ do done +test_expect_success 'git reflog expire honors core.sharedRepository' ' + git config core.sharedRepository group && + git reflog expire --all && + actual="$(ls -l .git/logs/refs/heads/master)" && + case "$actual" in + -rw-rw-*) + : happy + ;; + *) + echo Ooops, .git/logs/refs/heads/master is not 0662 [$actual] + false + ;; + esac +' + test_done -- 2.26.2