@matheusbsbs / matheus-bagliano / commits / 336d09daf2
Fork 0

Make git reflog expire honour core.sharedRepository.

Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pierre Habouzit committed Jun 15, 2008 at 23:37 UTC 336d09daf288492946f0c51f071da11643f8363d
2 files changed +17
builtin-reflog.c
+2
@@ -307,6 +307,8 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
307 unlink(newlog_path);
308 } else if (cmd->updateref && commit_ref(lock)) {
309 status |= error("Couldn't set %s", lock->ref_name);
310 + } else {
311 + adjust_shared_perm(log_file);
312 }
313 }
314 free(newlog_path);
t/t1301-shared-repo.sh
+15
@@ -83,4 +83,19 @@ do
83
84 done
85
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 +
101 test_done