get_patch_filename(): split into two functions
[gitweb.git] / builtin / log.c
index 3c6f20a2352622998a5d98dc412574838f911850..8cfb4da66291d4b3788e804a013f8e1d27633d51 100644 (file)
@@ -686,8 +686,10 @@ static int reopen_stdout(struct commit *commit, const char *subject,
 
        if (rev->numbered_files)
                strbuf_addf(&filename, "%d", rev->nr);
+       else if (commit)
+               fmt_output_commit(&filename, commit, rev);
        else
-               get_patch_filename(&filename, commit, subject, rev);
+               fmt_output_subject(&filename, subject, rev);
 
        if (!quiet)
                fprintf(realstdout, "%s\n", filename.buf + outdir_offset);