fmt-patch: understand old <his> notation
[git.git] / builtin-log.c
index 0027998..d5bbc1c 100644 (file)
@@ -11,6 +11,9 @@
 #include "log-tree.h"
 #include "builtin.h"
 
+/* this is in builtin-diff.c */
+void add_head(struct rev_info *revs);
+
 static int cmd_log_wc(int argc, const char **argv, char **envp,
                      struct rev_info *rev)
 {
@@ -185,6 +188,11 @@ int cmd_format_patch(int argc, const char **argv, char **envp)
        if (argc > 1)
                die ("unrecognized argument: %s", argv[1]);
 
+       if (rev.pending_objects && rev.pending_objects->next == NULL) {
+               rev.pending_objects->item->flags |= UNINTERESTING;
+               add_head(&rev);
+       }
+
        if (!use_stdout)
                realstdout = fdopen(dup(1), "w");