summaryrefslogtreecommitdiff
path: root/builtin-reset.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-03-01 23:43:32 -0800
committerJunio C Hamano <gitster@pobox.com>2008-03-01 23:52:13 -0800
commit2efb3b061709bd204f11d54c177dae89e4af0f67 (patch)
tree176701656ed7bc90a175f31b944b399c3b7ebdf8 /builtin-reset.c
parentb66fde9a287f64ed81d4d4a1639997ad5eedb432 (diff)
downloadgit-2efb3b061709bd204f11d54c177dae89e4af0f67.tar.gz
Clean up find_unique_abbrev() callers
Now find_unique_abbrev() never returns NULL, there is no need for callers to prepare for seeing NULL and fall back to giving the full 40-hexdigits. While we are at it, drop "..." in the "git reset" output that reports the location of the new HEAD, between the abbreviated commit object name and the one line commit summary. Because we are always showing the HEAD (which cannot be missing!), we never had a case where we show the full 40 hexdigits that is not followed by three dots, and these three dots were stealing 3 columns from the precious horizontal screen real estate out of 80 that can better be used for the one line commit summary. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-reset.c')
-rw-r--r--builtin-reset.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/builtin-reset.c b/builtin-reset.c
index af0037ec6e..bb3e19240a 100644
--- a/builtin-reset.c
+++ b/builtin-reset.c
@@ -63,14 +63,10 @@ static int reset_index_file(const unsigned char *sha1, int is_hard_reset)
static void print_new_head_line(struct commit *commit)
{
- const char *hex, *dots = "...", *body;
+ const char *hex, *body;
hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
- if (!hex) {
- hex = sha1_to_hex(commit->object.sha1);
- dots = "";
- }
- printf("HEAD is now at %s%s", hex, dots);
+ printf("HEAD is now at %s", hex);
body = strstr(commit->buffer, "\n\n");
if (body) {
const char *eol;