X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-reflog.c;h=749821078df129cf13de34ebbd40a8cb7a38e00e;hb=8a3c63e01d2b1df471beafff5fb78df4bade9388;hp=95198c5de41072bfb8adf7f29d9bbb44eec665ac;hpb=09ba7b2d9fc9142a2195082dd0e74c8161b6b744;p=git.git diff --git a/builtin-reflog.c b/builtin-reflog.c index 95198c5de..749821078 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -362,7 +362,7 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused, } else if (cmd->updateref && (write_in_full(lock->lock_fd, sha1_to_hex(cb.last_kept_sha1), 40) != 40 || - write_in_full(lock->lock_fd, "\n", 1) != 1 || + write_str_in_full(lock->lock_fd, "\n") != 1 || close_ref(lock) < 0)) { status |= error("Couldn't write %s", lock->lk->filename); @@ -698,6 +698,9 @@ static const char reflog_usage[] = int cmd_reflog(int argc, const char **argv, const char *prefix) { + if (argc > 1 && !strcmp(argv[1], "-h")) + usage(reflog_usage); + /* With no command, we default to showing it. */ if (argc < 2 || *argv[1] == '-') return cmd_log_reflog(argc, argv, prefix);