chiark / gitweb /
dgit-badcommit-fixup: Honour core.sharedRepository.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Jul 2017 19:46:12 +0000 (20:46 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 8 Jul 2017 19:46:13 +0000 (20:46 +0100)
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>
debian/changelog
dgit-badcommit-fixup

index cd44b4025eb049ad232d7762ab49ddf9b8b89c7f..729985c30792725c5a3d10c1da79ae9c74f0ad33 100644 (file)
@@ -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: 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.
   * infrastructure: Cope with new git-receive-pack which has
     quarantine feature: ie, work around #867702.
   * test suite: Cope with git restricting ext:: protocols.
index 8b202c0ae9617883d31239f6758843122cd2ff5c..3995ceb6e8c3349ad6565dcbd6157d0c9061a8db 100755 (executable)
@@ -59,6 +59,17 @@ my $bare = `git rev-parse --is-bare-repository`;
 die "$? $!" if $?;
 chomp $bare or die;
 
 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 $!;
 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 $!;
     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;
 
 
     my %map;