unsigned long timestamp)
{
int i;
- for (i = array->nr - 1; i >= 0; i++)
+ for (i = array->nr - 1; i >= 0; i--)
if (timestamp >= array->items[i].timestamp)
return i;
return -1;
if (item)
reflogs = item->util;
else {
+ if (*branch == '\0') {
+ unsigned char sha1[20];
+ const char *head = resolve_ref("HEAD", sha1, 0, NULL);
+ if (!head)
+ die ("No current branch");
+ free(branch);
+ branch = xstrdup(head);
+ }
reflogs = read_complete_reflog(branch);
if (!reflogs || reflogs->nr == 0)
die("No reflogs found for '%s'", branch);
else
printf("%d", commit_reflog->reflogs->nr
- 2 - commit_reflog->recno);
- printf("}: ");
+ printf("}: %s", info->message);
}
else {
printf("Reflog: %s@{", commit_reflog->reflogs->ref);