diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-07-08 20:46:12 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-07-08 20:46:13 +0100 |
commit | 5e493b95a805efe689f3c34f50731db568978c4a (patch) | |
tree | eae6f359f0484130bdf265a375d63a4c426ab74e | |
parent | 814fa4dc0dbf43f7b2ec57803a155d03ba136a9b (diff) |
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 <ijackson@chiark.greenend.org.uk>
-rw-r--r-- | debian/changelog | 2 | ||||
-rwxr-xr-x | dgit-badcommit-fixup | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index cd44b40..729985c 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 8b202c0..3995ceb 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; |