Skip to content

Commit

Permalink
http-push: clarify the reason of error from the initial PROPFIND request
Browse files Browse the repository at this point in the history
The first thing http-push does is a PROPFIND to see if the other
end supports locking.  The failure message we give is always
reported as "no DAV locking support at the remote repository",
regardless of the reason why we ended up not finding the locking
support on the other end.

This moves the code to report "no DAV locking support" down the
codepath so that the message is issued only when we successfully
get a response to PROPFIND and the other end say it does not
support locking.  Other failures, such as connectivity glitches
and credential mismatches, have their own error message issued
and we will not issue "no DAV locking" error (we do not even
know if the remote end supports it).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Jan 20, 2008
1 parent 9bdbaba commit 325ce39
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,9 +1563,17 @@ static int locking_available(void)
lock_flags = 0;
}
XML_ParserFree(parser);
if (!lock_flags)
error("Error: no DAV locking support on %s",
remote->url);

} else {
error("Cannot access URL %s, return code %d",
remote->url, results.curl_result);
lock_flags = 0;
}
} else {
fprintf(stderr, "Unable to start PROPFIND request\n");
error("Unable to start PROPFIND request on %s", remote->url);
}

strbuf_release(&out_buffer.buf);
Expand Down Expand Up @@ -2230,7 +2238,6 @@ int main(int argc, char **argv)

/* Verify DAV compliance/lock support */
if (!locking_available()) {
fprintf(stderr, "Error: no DAV locking support on remote repo %s\n", remote->url);
rc = 1;
goto cleanup;
}
Expand Down

0 comments on commit 325ce39

Please sign in to comment.