summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/show-branch.c')
-rw-r--r--builtin/show-branch.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 717a8e7665..25669357e9 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -291,7 +291,7 @@ static void show_one_commit(struct commit *commit, int no_name)
}
else
printf("[%s] ",
- find_unique_abbrev(commit->object.sha1,
+ find_unique_abbrev(commit->object.oid.hash,
DEFAULT_ABBREV));
}
puts(pretty_str);
@@ -496,7 +496,7 @@ static int show_merge_base(struct commit_list *seen, int num_rev)
int flags = commit->object.flags & all_mask;
if (!(flags & UNINTERESTING) &&
((flags & all_revs) == all_revs)) {
- puts(sha1_to_hex(commit->object.sha1));
+ puts(oid_to_hex(&commit->object.oid));
exit_status = 0;
commit->object.flags |= UNINTERESTING;
}
@@ -516,7 +516,7 @@ static int show_independent(struct commit **rev,
unsigned int flag = rev_mask[i];
if (commit->object.flags == flag)
- puts(sha1_to_hex(commit->object.sha1));
+ puts(oid_to_hex(&commit->object.oid));
commit->object.flags |= UNINTERESTING;
}
return 0;
@@ -724,6 +724,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
fake_av[1] = NULL;
av = fake_av;
ac = 1;
+ if (!*av)
+ die("no branches given, and HEAD is not valid");
}
if (ac != 1)
die("--reflog option needs one branch name");
@@ -865,7 +867,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
head_len,
ref_name[i],
head_oid.hash,
- rev[i]->object.sha1);
+ rev[i]->object.oid.hash);
if (extra < 0)
printf("%c [%s] ",
is_head ? '*' : ' ', ref_name[i]);