diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-06-28 17:00:19 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-07-08 18:54:00 +0100 |
commit | 3441896d54a67afcf18987eed287061d2afea956 (patch) | |
tree | 436740b679b8bb2cfb0a6525e4bf02321fe8cae8 /dgit | |
parent | 1171def5bb4f2659d19718ad39c81c1aa6b162cd (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>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -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; |