X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=dgit;h=1f065dd3bbc9436804f53a52bfa50fb117553dc0;hb=ae3881653a4639a9c3017ffdb187b49ebe9fcea3;hp=ebf44de800ed399aa56644928f01461c9694d67a;hpb=6c5051457d8e3decc94625cf5bf218be6d6d7fcc;p=dgit.git diff --git a/dgit b/dgit index ebf44de8..1f065dd3 100755 --- a/dgit +++ b/dgit @@ -561,11 +561,6 @@ sub runcmd_ordryrun_local { } } -sub shell_cmd { - my ($first_shell, @cmd) = @_; - return qw(sh -ec), $first_shell.'; exec "$@"', 'x', @cmd; -} - our $helpmsg = <) { - return 1 if m{^\[attr\]dgit-defuse-attrs\s}; + next unless m{$gitattrs_ourmacro_re}; + return 1 if m{\s-working-tree-encoding\s}; + printdebug "is_gitattrs_setup: found old macro\n"; + return 0; } $gai->error and die $!; - return 0; + printdebug "is_gitattrs_setup: found nothing\n"; + return undef; } sub setup_gitattrs (;$) { my ($always) = @_; return unless $always || access_cfg_bool(1, 'setup-gitattributes'); - if (is_gitattrs_setup()) { + my $already = is_gitattrs_setup(); + if ($already) { progress < $af.new" or die $!; - print GAO <) { + if (m{$gitattrs_ourmacro_re}) { + die unless defined $already; + $_ = $new; + } chomp; print GAO $_, "\n" or die $!; } @@ -3459,7 +3473,7 @@ sub check_gitattrs ($$) { # oh dear, found one print STDERR <[0] } @vsns;