summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-06-28 17:00:19 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-07-08 18:54:00 +0100
commit3441896d54a67afcf18987eed287061d2afea956 (patch)
tree436740b679b8bb2cfb0a6525e4bf02321fe8cae8
parent1171def5bb4f2659d19718ad39c81c1aa6b162cd (diff)
dgit: Add many pre_* to call no_local_git_cfg
For each operation which can meaningfully be run outside a git tree, arrange to call no_local_git_cfg and thus avoid running git config --local There is one slight infelicity: some subcommands (notably archive-api-query) could in theory be run within a git tree and expect that git tree to influence their output. However, this seems unlikely. In fact, I think there are probably only in-tree callers and the in-tree callers do not do this. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rw-r--r--debian/changelog2
-rwxr-xr-xdgit18
2 files changed, 20 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 682a44f..3ee2de8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ dgit (3.11~) unstable; urgency=medium
Closes:#867693.
* dgit: Cope if the archive server sends an HTTP redirect,
by passing -L to curl. Closes:#867185,#867309.
+ * dgit: Cope with newer git which hates --local outside a working
+ tree. Closes:#865863.
* dgit: rpush: Honour local git config from build host working
tree.
* test suite: Cope with git restricting ext:: protocols.
diff --git a/dgit b/dgit
index 51a2ccb..43f3fd3 100755
--- a/dgit
+++ b/dgit
@@ -566,6 +566,9 @@ sub nextarg {
return scalar shift @ARGV;
}
+sub pre_help () {
+ no_local_git_cfg();
+}
sub cmd_help () {
print $helpmsg or die $!;
exit 0;
@@ -4414,6 +4417,9 @@ END
responder_send_command("complete");
}
+sub pre_clone () {
+ no_local_git_cfg();
+}
sub cmd_clone {
parseopts();
my $dstdir;
@@ -4624,6 +4630,9 @@ sub i_method {
{ no strict qw(refs); &{"${base}_${selector}"}(@args); }
}
+sub pre_rpush () {
+ no_local_git_cfg();
+}
sub cmd_rpush {
my $host = nextarg;
my $dir;
@@ -6380,6 +6389,9 @@ END
"results are in in git ref $dstbranch";
}
+sub pre_archive_api_query () {
+ no_local_git_cfg();
+}
sub cmd_archive_api_query {
badusage "need only 1 subpath argument" unless @ARGV==1;
my ($subpath) = @ARGV;
@@ -6396,6 +6408,9 @@ sub repos_server_url () {
my $url = access_giturl();
}
+sub pre_clone_dgit_repos_server () {
+ no_local_git_cfg();
+}
sub cmd_clone_dgit_repos_server {
badusage "need destination argument" unless @ARGV==1;
my ($destdir) = @ARGV;
@@ -6405,6 +6420,9 @@ sub cmd_clone_dgit_repos_server {
exec @cmd or fail "exec git clone: $!\n";
}
+sub pre_print_dgit_repos_server_source_url () {
+ no_local_git_cfg();
+}
sub cmd_print_dgit_repos_server_source_url {
badusage "no arguments allowed to dgit print-dgit-repos-server-source-url"
if @ARGV;