summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdgit5
1 files changed, 3 insertions, 2 deletions
diff --git a/dgit b/dgit
index 6d9baca..97cd684 100755
--- a/dgit
+++ b/dgit
@@ -1009,9 +1009,9 @@ sub archive_api_query_cmd ($) {
return @cmd;
}
-sub api_query ($$) {
+sub api_query ($$;$) {
use JSON;
- my ($data, $subpath) = @_;
+ my ($data, $subpath, $ok404) = @_;
badcfg "ftpmasterapi archive query method takes no data part"
if length $data;
my @cmd = archive_api_query_cmd($subpath);
@@ -1023,6 +1023,7 @@ sub api_query ($$) {
fail "curl failed to print 3-digit HTTP code";
}
my $code = $&;
+ return undef if $code eq '404' && $ok404;
fail "fetch of $url gave HTTP code $code"
unless $url =~ m#^file://# or $code =~ m/^2/;
return decode_json($json);