Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2008-05-26 06:17:57 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-26 07:29:30 +0400
commit97561fff3263add59ec25207a0c5a635b28ce9b9 (patch)
treec1dff2b66a00242996416d163840e6aa0b7bc252 /contrib
parent48ded91674604c9756d53a7e657da0196795136f (diff)
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>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/hooks/update-paranoid14
1 files changed, 6 insertions, 8 deletions
diff --git a/contrib/hooks/update-paranoid b/contrib/hooks/update-paranoid
index 068fa37083..6e0d97c89f 100644
--- a/contrib/hooks/update-paranoid
+++ b/contrib/hooks/update-paranoid
@@ -225,14 +225,12 @@ sub load_diff ($) {
local $/ = "\0";
my %this_diff;
if ($base =~ /^0{40}$/) {
- open(T,'-|','git','ls-tree',
- '-r','--name-only','-z',
- $new) or return undef;
- while (<T>) {
- chop;
- $this_diff{$_} = 'A';
- }
- close T or return undef;
+ # Don't load the diff at all; we are making the
+ # branch and have no base to compare to in this
+ # case. A file level ACL makes no sense in this
+ # context. Having an empty diff will allow the
+ # branch creation.
+ #
} else {
open(T,'-|','git','diff-tree',
'-r','--name-status','-z',