Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-02 20:13:34 +0300
committerJunio C Hamano <gitster@pobox.com>2023-05-02 20:13:35 +0300
commitcf85f4b3bd34469b75b7453f9de0315534406a41 (patch)
treeb92786b3c95ede0abb7c77ef98f9e8fa7e3beca7 /blame.c
parentf357d46adacb8d7f2c465a00c66a57d925396bfe (diff)
parent603d0fdce2ca84d4dc7b26e46430778fe9c4cb72 (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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/blame.c b/blame.c
index 58dd58b6c9..b830654062 100644
--- a/blame.c
+++ b/blame.c
@@ -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",