summaryrefslogtreecommitdiff
path: root/builtin-name-rev.c
diff options
context:
space:
mode:
authorPieter de Bie <pdebie@ai.rug.nl>2008-07-31 15:20:34 +0200
committerJunio C Hamano <gitster@pobox.com>2008-08-02 11:07:50 -0700
commitb003c00b7b5e352569061fec0b1e1bd0d0fa8b6a (patch)
treea9010bba1851438980c6a10efba4000fc4cd3f3e /builtin-name-rev.c
parente8b55fab6237b30494aa1905c3209d5bf5494a29 (diff)
downloadgit-b003c00b7b5e352569061fec0b1e1bd0d0fa8b6a.tar.gz
git-name-rev: allow --name-only in combination with --stdin
Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-name-rev.c')
-rw-r--r--builtin-name-rev.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin-name-rev.c b/builtin-name-rev.c
index b75c73b224..ff7d638dc2 100644
--- a/builtin-name-rev.c
+++ b/builtin-name-rev.c
@@ -204,8 +204,13 @@ static void name_rev_line(char *p, struct name_ref_data *data)
if (!name)
continue;
- fwrite(p_start, p - p_start + 1, 1, stdout);
- printf(" (%s)", name);
+ if (data->name_only) {
+ fwrite(p_start, p - p_start + 1 - 40, 1, stdout);
+ printf(name);
+ } else {
+ fwrite(p_start, p - p_start + 1, 1, stdout);
+ printf(" (%s)", name);
+ }
p_start = p + 1;
}
}