From: Ian Jackson Date: Sat, 8 Jul 2017 19:46:12 +0000 (+0100) Subject: dgit-badcommit-fixup: Honour core.sharedRepository. X-Git-Tag: archive/debian/3.11~7 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=5e493b95a805efe689f3c34f50731db568978c4a dgit-badcommit-fixup: Honour core.sharedRepository. Closes:#867603. In principle it might be nicer to copy more options. But we don't want to duplicate the logic in prep_ud in dgit, and we don't want to make this script too standalone. I'm not aware of other options that are important, rather than nice-to-have tuneables. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index cd44b402..729985c3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,6 +13,8 @@ dgit (3.11~) unstable; urgency=medium * dgit: honour more pre-tree git config options in our private trees sharing the user's object store. In particular, core.sharedRepository. Prompted by #867603. + * dgit-badcommit-fixup: Honour core.sharedRepository. + Closes:#867603. * infrastructure: Cope with new git-receive-pack which has quarantine feature: ie, work around #867702. * test suite: Cope with git restricting ext:: protocols. diff --git a/dgit-badcommit-fixup b/dgit-badcommit-fixup index 8b202c0a..3995ceb6 100755 --- a/dgit-badcommit-fixup +++ b/dgit-badcommit-fixup @@ -59,6 +59,17 @@ my $bare = `git rev-parse --is-bare-repository`; die "$? $!" if $?; chomp $bare or die; +our @configs; +foreach my $k (qw(core.sharedRepository)) { + $?=0; $!=0; my $v = `set -x; git config --local $k`; + if (defined $v && $?==0 && chomp $v) { + push @configs, [ $k, $v ]; + } elsif (defined $v && $?==256 && $v eq '') { + } else { + die "git-config --local $k => $v $? $! ?"; + } +} + sub getobj ($$) { my ($obj, $type) = @_; print GCFI $obj, "\n" or die $!; @@ -163,6 +174,9 @@ sub edit_rewrite_map ($) { runcmd qw(git config gc.auto 0); runcmd qw(rm -rf .git/objects); symlink "../../objects", ".git/objects" or die $!; + foreach my $c (@configs) { + runcmd qw(git config), $c->[0], $c->[1]; + } my %map;