Re: Multiple fetches when unshallowing a shallow clone
From: Duy Nguyen <hidden>
Date: 2016-06-15 23:07:24
On Mon, Dec 7, 2015 at 8:57 PM, Jason Paller-Rzepka [off-list ref] wrote:
Duy, you mentioned that depth=0 means "do not change depth". I assume that means the server should use exactly the shallows that the client sent, and it does not need to traverse the tree or modify the shallow or unshallow sets at all. Right?
Correct. The server might send new shallow lines anyway though, if the server repo is also shallow and the new fetched ref needs to be cut. But I don't know if Dulwich supports that yet.
Duy, you also mentioned that "those lines should be rejected any way". You just mean that a "deepen 0" line should be rejected, right? And that's because the right way to tell git-upload-pack not to change the depth is to omit the "deepen" line after the "shallow" lines, so there's never a need to send "deepen 0"?
Also correct. I didn't check the code when I wrote that. But I have
checked and upload-pack does reject "deepen 0"
if (starts_with(line, "deepen ")) {
char *end;
depth = strtol(line + 7, &end, 0);
if (end == line + 7 || depth <= 0)
die("Invalid deepen: %s", line);
--
Duy