Skip to content

Commit 325ce39

Browse files
committed
http-push: clarify the reason of error from the initial PROPFIND request
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 <[email protected]>
1 parent 9bdbaba commit 325ce39

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

http-push.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,9 +1563,17 @@ static int locking_available(void)
15631563
lock_flags = 0;
15641564
}
15651565
XML_ParserFree(parser);
1566+
if (!lock_flags)
1567+
error("Error: no DAV locking support on %s",
1568+
remote->url);
1569+
1570+
} else {
1571+
error("Cannot access URL %s, return code %d",
1572+
remote->url, results.curl_result);
1573+
lock_flags = 0;
15661574
}
15671575
} else {
1568-
fprintf(stderr, "Unable to start PROPFIND request\n");
1576+
error("Unable to start PROPFIND request on %s", remote->url);
15691577
}
15701578

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

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

0 commit comments

Comments
 (0)