X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=b7888afb7673da6cab9f06a87e64cbb33adbc1ea;hb=7dcdcdd7c58d7ea097088f76909b04d0ba0db5f6;hp=be11a49802720fe06df4bfd3c7992752aa0c5ec4;hpb=ff7e17f00e19a8940b2a58edc395e24f927a56d2;p=dgit.git diff --git a/dgit b/dgit index be11a498..b7888afb 100755 --- a/dgit +++ b/dgit @@ -144,6 +144,7 @@ our %opts_cfg_insertpos = map { sub parseopts_late_defaults(); sub setup_gitattrs(;$); +sub check_gitattrs($$); our $keyid; @@ -668,7 +669,7 @@ sub git_get_config ($) { my ($c) = @_; foreach my $src (@gitcfgsources) { my $l = $gitcfgs{$src}{$c}; - croak "$l $c" if $l && !ref $l; + confess "internal error ($l $c)" if $l && !ref $l; printdebug"C $c ".(defined $l ? join " ", map { messagequote "'$_'" } @$l : "undef")."\n" @@ -1698,7 +1699,7 @@ sub mktree_in_ud_here () { runcmd qw(git config gc.auto 0); rmtree('.git/objects'); symlink '../../../../objects','.git/objects' or die $!; - setup_gitattrs(); + setup_gitattrs(1); } sub git_write_tree () { @@ -2571,7 +2572,7 @@ sub lrfetchref_used ($) { } sub git_lrfetch_sane { - my ($supplementary, @specs) = @_; + my ($url, $supplementary, @specs) = @_; # Make a 'refs/'.lrfetchrefs.'/*' be just like on server, # at least as regards @specs. Also leave the results in # %lrfetchrefs_f, and arrange for lrfetchref_used to be @@ -2602,8 +2603,6 @@ sub git_lrfetch_sane { # git fetch to try to generate it. If we don't manage to generate # the target state, we try again. - my $url = access_giturl(); - printdebug "git_lrfetch_sane suppl=$supplementary specs @specs\n"; my $specre = join '|', map { @@ -2743,7 +2742,8 @@ sub git_fetch_us () { push @specs, $rewritemap; push @specs, qw(heads/*) if deliberately_not_fast_forward; - git_lrfetch_sane 0, @specs; + my $url = access_giturl(); + git_lrfetch_sane $url, 0, @specs; my %here; my @tagpats = debiantags('*',access_nomdistro); @@ -2872,13 +2872,13 @@ END or fail <) { + chomp or die; + s/^\d+\s+\w+\s+\w+\s+(\d+)\t// or die; + next if $1 == 0; + next unless m{(?:^|/)\.gitattributes$}; + + # oh dear, found one + print STDERR <(), and returns undef @@ -3569,6 +3600,7 @@ sub clone ($) { mkdir $dstdir or fail "create \`$dstdir': $!"; changedir $dstdir; runcmd @git, qw(init -q); + setup_new_tree(); clone_set_head(); my $giturl = access_giturl(1); if (defined $giturl) { @@ -3587,7 +3619,6 @@ sub clone ($) { $vcsgiturl =~ s/\s+-b\s+\S+//g; runcmd @git, qw(remote add vcs-git), $vcsgiturl; } - setup_new_tree(); clone_finish($dstdir); } @@ -6103,6 +6134,8 @@ sub import_dsc_result { my ($dstref, $newhash, $what_log, $what_msg) = @_; my @cmd = (@git, qw(update-ref -m), $what_log, $dstref, $newhash); runcmd @cmd; + check_gitattrs($newhash, "source tree"); + progress "dgit: import-dsc: $what_msg"; }