From 0fa06a8a65316df18b15204931af943e03e9c013 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 17 Feb 2018 12:56:15 +1200 Subject: [PATCH] vc-dwim: port to 5.x that don't automatically use Cwd * vc-dwim.pl (do_at): "use Cwd" here, too. Otherwise, "vc-dwim --init" would fail at least with perl v5.16.3. The new use of do_at exposed that this function used the Cwd module without first ensuring that it is available. --- vc-dwim.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vc-dwim.pl b/vc-dwim.pl index 558ae36..75a87fc 100755 --- a/vc-dwim.pl +++ b/vc-dwim.pl @@ -549,6 +549,8 @@ sub do_commit ($$$$) sub do_at($$) { my ($dest_dir, $code) = @_; + eval 'use Cwd'; + die $@ if $@; my $initial_wd = Cwd::getcwd() or die "$ME: getcwd failed: $!\n"; chdir $dest_dir -- 2.13.5