Make git reflog expire honour core.sharedRepository.
Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
4744d72393
commit
336d09daf2
@ -307,6 +307,8 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
|
|||||||
unlink(newlog_path);
|
unlink(newlog_path);
|
||||||
} else if (cmd->updateref && commit_ref(lock)) {
|
} else if (cmd->updateref && commit_ref(lock)) {
|
||||||
status |= error("Couldn't set %s", lock->ref_name);
|
status |= error("Couldn't set %s", lock->ref_name);
|
||||||
|
} else {
|
||||||
|
adjust_shared_perm(log_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(newlog_path);
|
free(newlog_path);
|
||||||
|
@ -83,4 +83,19 @@ do
|
|||||||
|
|
||||||
done
|
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
|
test_done
|
||||||
|
Reference in New Issue
Block a user