chiark / gitweb /
Dgit: break must_getcwd out into Dgit.pm
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 28 Jul 2017 17:33:52 +0000 (18:33 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 2 Aug 2017 14:56:56 +0000 (15:56 +0100)
No functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm
dgit

index 399aaad..1d713b9 100644 (file)
@@ -44,7 +44,7 @@ BEGIN {
                      server_branch server_ref
                       stat_exists link_ltarget
                      hashfile
-                      fail ensuredir executable_on_path
+                      fail ensuredir must_getcwd executable_on_path
                       waitstatusmsg failedcmd_waitstatus
                      failedcmd_report_cmd failedcmd
                       runcmd cmdoutput cmdoutput_errok
@@ -224,6 +224,12 @@ sub ensuredir ($) {
     die "mkdir $dir: $!";
 }
 
+sub must_getcwd () {
+    my $d = getcwd();
+    defined $d or fail "getcwd failed: $!";
+    return $d;
+}
+
 sub executable_on_path ($) {
     my ($program) = @_;
     return 1 if $program =~ m{/};
diff --git a/dgit b/dgit
index d772a90..6780af7 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -985,12 +985,6 @@ sub commit_getclogp ($) {
     $commit_getclogp_memo{$objid} = parsechangelog("-l$mclog");
 }
 
-sub must_getcwd () {
-    my $d = getcwd();
-    defined $d or fail "getcwd failed: $!";
-    return $d;
-}
-
 sub parse_dscdata () {
     my $dscfh = new IO::File \$dscdata, '<' or die $!;
     printdebug Dumper($dscdata) if $debuglevel>1;