summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2014-10-27 17:46:11 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2014-11-08 16:07:56 +0000
commite41608c3549b3e34839ad15b2e29607794c1ccd6 (patch)
tree44204b617aaa8583c35be20a9ef2341472a701af /dgit
parentece82c50afff320eaf1cd09ba540e10f24984b60 (diff)
Break out get_source_format (nfc)
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit21
1 files changed, 13 insertions, 8 deletions
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>;
+ 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>;
- 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));