chiark / gitweb /
dgit: Change to git toplevel dir before starting
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Oct 2018 00:15:36 +0000 (01:15 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Oct 2018 00:15:36 +0000 (01:15 +0100)
Closes: #910724.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 5b223af..3591231 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -7376,7 +7376,10 @@ $cmd =~ y/-/_/;
 my $pre_fn = ${*::}{"pre_$cmd"};
 $pre_fn->() if $pre_fn;
 
-record_maindir if $invoked_in_git_tree;
+if ($invoked_in_git_tree) {
+    changedir_git_toplevel();
+    record_maindir();
+}
 git_slurp_config();
 
 my $fn = ${*::}{"cmd_$cmd"};