Skip to content

Commit

Permalink
Make git reflog expire honour core.sharedRepository.
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Pierre Habouzit authored and Junio C Hamano committed Jun 15, 2008
1 parent 4744d72 commit 336d09d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions builtin-reflog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions t/t1301-shared-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 336d09d

Please sign in to comment.