[PATCH] format-patch: avoid generation of empty patches
- From
- Alexander Potashev <aspotashev@gmail.com>
- Date
- Jan 10, 2009, 11:39 UTC
- Message-ID
- <20090110113903.GB25723@myhost>
- In-Reply-To
- <20090110113642.GA25723@myhost>
If 'log.showroot' is not set, format-patch shouldn't even try to create a patch for the root commit.
Signed-off-by: Alexander Potashev <aspotashev@gmail.com> --- builtin-log.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-log.c b/builtin-log.c index 4a02ee9..62134d4 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -972,6 +972,9 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) has_commit_patch_id(commit, &ids)) continue; + if (!commit->parents && !rev.show_root_diff) + break; + nr++; list = xrealloc(list, nr * sizeof(list[0])); list[nr - 1] = commit;
-- 1.6.1.77.g569c.dirty