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 /dgit-badcommit-fixup | |
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>
Diffstat (limited to 'dgit-badcommit-fixup')
-rwxr-xr-x | dgit-badcommit-fixup | 14 |
1 files changed, 14 insertions, 0 deletions
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; |