diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-05-02 20:13:34 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-05-02 20:13:35 +0300 |
commit | cf85f4b3bd34469b75b7453f9de0315534406a41 (patch) | |
tree | b92786b3c95ede0abb7c77ef98f9e8fa7e3beca7 /blame.c | |
parent | f357d46adacb8d7f2c465a00c66a57d925396bfe (diff) | |
parent | 603d0fdce2ca84d4dc7b26e46430778fe9c4cb72 (diff) |
Merge branch 'jk/blame-fake-commit-label'
The output given by "git blame" that attributes a line to contents
taken from the file specified by the "--contents" option shows it
differently from a line attributed to the working tree file.
* jk/blame-fake-commit-label:
blame: use different author name for fake commit generated by --contents
Diffstat (limited to 'blame.c')
-rw-r--r-- | blame.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -208,8 +208,12 @@ static struct commit *fake_working_tree_commit(struct repository *r, origin = make_origin(commit, path); - ident = fmt_ident("Not Committed Yet", "not.committed.yet", - WANT_BLANK_IDENT, NULL, 0); + if (contents_from) + ident = fmt_ident("External file (--contents)", "external.file", + WANT_BLANK_IDENT, NULL, 0); + else + ident = fmt_ident("Not Committed Yet", "not.committed.yet", + WANT_BLANK_IDENT, NULL, 0); strbuf_addstr(&msg, "tree 0000000000000000000000000000000000000000\n"); for (parent = commit->parents; parent; parent = parent->next) strbuf_addf(&msg, "parent %s\n", |