| 4468 | } |
| 4469 | |
| 4470 | static int diff_populate_gitlink(struct diff_filespec *s, int size_only) |
| 4471 | { |
| 4472 | struct strbuf buf = STRBUF_INIT; |
| 4473 | const char *dirty = ""; |
| 4474 | |
| 4475 | /* Are we looking at the work tree? */ |
| 4476 | if (s->dirty_submodule) |
| 4477 | dirty = "-dirty"; |
| 4478 | |
| 4479 | strbuf_addf(&buf, "Subproject commit %s%s\n", |
| 4480 | oid_to_hex(&s->oid), dirty); |
| 4481 | s->size = buf.len; |
| 4482 | if (size_only) { |
| 4483 | s->data = NULL; |
| 4484 | strbuf_release(&buf); |
| 4485 | } else { |
| 4486 | s->data = strbuf_detach(&buf, NULL); |
| 4487 | s->should_free = 1; |
| 4488 | } |
| 4489 | return 0; |
| 4490 | } |
| 4491 | |
| 4492 | /* |
| 4493 | * While doing rename detection and pickaxe operation, we may need to |
no test coverage detected