mirror of
https://github.com/git/git
synced 2024-08-28 20:20:07 +00:00
Don't diff empty tree on branch creation in paranoid update hook
Listing all files in a branch during branch creation is silly; the user's file-level ACLs probably don't mean anything at this point. We now treat the base case of 0{40} as an empty diff, as this happens only when the user is creating the branch and there are file level ACLs that diff against the old value of the branch. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
48ded91674
commit
97561fff32
|
@ -225,14 +225,12 @@ sub load_diff ($) {
|
||||||
local $/ = "\0";
|
local $/ = "\0";
|
||||||
my %this_diff;
|
my %this_diff;
|
||||||
if ($base =~ /^0{40}$/) {
|
if ($base =~ /^0{40}$/) {
|
||||||
open(T,'-|','git','ls-tree',
|
# Don't load the diff at all; we are making the
|
||||||
'-r','--name-only','-z',
|
# branch and have no base to compare to in this
|
||||||
$new) or return undef;
|
# case. A file level ACL makes no sense in this
|
||||||
while (<T>) {
|
# context. Having an empty diff will allow the
|
||||||
chop;
|
# branch creation.
|
||||||
$this_diff{$_} = 'A';
|
#
|
||||||
}
|
|
||||||
close T or return undef;
|
|
||||||
} else {
|
} else {
|
||||||
open(T,'-|','git','diff-tree',
|
open(T,'-|','git','diff-tree',
|
||||||
'-r','--name-status','-z',
|
'-r','--name-status','-z',
|
||||||
|
|
Loading…
Reference in a new issue