chiark / gitweb /
Dgit.pm: changedir: Break out from dgit
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 14 Jul 2017 15:36:22 +0000 (16:36 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 19 Jul 2017 00:12:03 +0000 (01:12 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Debian/Dgit.pm
dgit

index 1f9c827..e25a3af 100644 (file)
@@ -59,7 +59,7 @@ BEGIN {
                       $debugprefix *debuglevel *DEBUG
                       shellquote printcmd messagequote
                       $negate_harmful_gitattrs
-                     git_slurp_config_src
+                     changedir git_slurp_config_src
                      workarea_setup
                      fresh_workarea in_workarea);
     # implicitly uses $main::us
@@ -420,6 +420,12 @@ sub is_fast_fwd ($$) {
     }
 }
 
+sub changedir ($) {
+    my ($newdir) = @_;
+    printdebug "CD $newdir\n";
+    chdir $newdir or confess "chdir: $newdir: $!";
+}
+
 sub git_slurp_config_src ($) {
     my ($src) = @_;
     # returns $r such that $r->{KEY}[] = VALUE
diff --git a/dgit b/dgit
index 4b19384..28795fe 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -249,12 +249,6 @@ sub no_such_package () {
     exit 4;
 }
 
-sub changedir ($) {
-    my ($newdir) = @_;
-    printdebug "CD $newdir\n";
-    chdir $newdir or confess "chdir: $newdir: $!";
-}
-
 sub deliberately ($) {
     my ($enquiry) = @_;
     return !!grep { $_ eq "--deliberately-$enquiry" } @deliberatelies;