diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-07-28 18:33:52 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-08-02 15:56:56 +0100 |
commit | 9ecc454c514558e7d49fa47083a69e456cc33239 (patch) | |
tree | 71c7943f04af5c53dcb8375d8db883c82313af30 /Debian/Dgit.pm | |
parent | 8329968f62aaccced6b1777be64f2286acb50e4e (diff) |
Dgit: break must_getcwd out into Dgit.pm
No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'Debian/Dgit.pm')
-rw-r--r-- | Debian/Dgit.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 399aaad..1d713b9 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -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{/}; |