From: Ian Jackson Date: Mon, 27 Oct 2014 17:46:11 +0000 (+0000) Subject: Break out get_source_format (nfc) X-Git-Tag: debian/0.30~315 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=e41608c3549b3e34839ad15b2e29607794c1ccd6;ds=inline Break out get_source_format (nfc) --- diff --git a/dgit b/dgit index 9d8f9d42..d00ab1f0 100755 --- a/dgit +++ b/dgit @@ -1389,6 +1389,17 @@ sub commit_quilty_patch () { commit_admin "Commit Debian 3.0 (quilt) metadata"; } +sub get_source_format () { + if (!open F, "debian/source/format") { + die $! unless $!==&ENOENT; + return ''; + } + $_ = ; + F->error and die $!; + chomp; + return $_; +} + sub madformat ($) { my ($format) = @_; return 0 unless $format eq '3.0 (quilt)'; @@ -1947,14 +1958,8 @@ our $dscfn; our $fakeeditorenv = 'DGIT_FAKE_EDITOR_QUILT'; sub build_maybe_quilt_fixup () { - if (!open F, "debian/source/format") { - die $! unless $!==&ENOENT; - return; - } - $_ = ; - F->error and die $!; - chomp; - return unless madformat($_); + my $format=get_source_format; + return unless madformat $format; # sigh my @cmd = (@git, qw(ls-files --exclude-standard -iodm));