[cr] RFR: 988: Skara webrev is empty if patch has deleted files

Erik Helin ehelin at openjdk.java.net
Fri Apr 23 09:44:50 UTC 2021

On Thu, 22 Apr 2021 21:35:43 GMT, Erik Joelsson <erikj at openjdk.org> wrote:

> If a file in the patch has been deleted this causes a dereference of an undefined value. To fix this I removed the quick return in fetchFileContent so that this function always returns a value.
> While verifying this, I also noted that the deleted file gets a Raw link which results in a 404. I think it should just not print the Raw link so I removed that too.
> If a file has only been renamed, with no other changes, the patch will be an empty string. This upsets the hunk loop, so I added a case for handling this.
> The resulting webrevs from the two reported patches look correct to me with these changes, but I would appreciate some more eyes on this.

index.html line 504:

> 502:             code.append(patchFile, " ");
> 503: 
> 504:             code.append("--- ");

Nice catch!

index.html line 1521:

> 1519:         } else if (line.startsWith("\\ No newline at end of file")) {
> 1520:             continue;
> 1521:         } else if (line == "") {

Perhaps use `===`?


PR: https://git.openjdk.java.net/cr/pull/14

More information about the skara-dev mailing list