Code

tag.h: Remove unused signature field
[git.git] / builtin-reflog.c
index 249ad2a311f2e9680618870aed3ac053c9fcf7a1..749821078df129cf13de34ebbd40a8cb7a38e00e 100644 (file)
@@ -240,10 +240,10 @@ static int unreachable(struct expire_reflog_cb *cb, struct commit *commit, unsig
 static void mark_reachable(struct commit *commit, unsigned long expire_limit)
 {
        /*
-        * We need to compute if commit on either side of an reflog
+        * We need to compute whether the commit on either side of a reflog
         * entry is reachable from the tip of the ref for all entries.
         * Mark commits that are reachable from the tip down to the
-        * time threashold first; we know a commit marked thusly is
+        * time threshold first; we know a commit marked thusly is
         * reachable from the tip without running in_merge_bases()
         * at all.
         */
@@ -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);
@@ -694,10 +694,13 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
  */
 
 static const char reflog_usage[] =
-"git reflog (expire | ...)";
+"git reflog [ show | expire | delete ]";
 
 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);