From e41608c3549b3e34839ad15b2e29607794c1ccd6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 27 Oct 2014 17:46:11 +0000 Subject: Break out get_source_format (nfc) --- dgit | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'dgit') diff --git a/dgit b/dgit index 9d8f9d4..d00ab1f 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)); -- cgit v1.2.3