Code

Make git reflog expire honour core.sharedRepository.
authorPierre Habouzit <madcoder@debian.org>
Sun, 15 Jun 2008 21:37:42 +0000 (23:37 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 15 Jun 2008 22:54:06 +0000 (15:54 -0700)
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-reflog.c
t/t1301-shared-repo.sh

index 897d1dcac6b34e0c631c94b98c489db075e90bb2..b151e24ff94e06840db7e57014fe4a73ea811575 100644 (file)
@@ -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);
index 5e4252a320d5f967eacb9bd68bb0a510fe748e80..6c78c8bc9b76828c258f524e73b40d7daff7c305 100755 (executable)
@@ -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