SHA256
1
0
forked from pool/patch
patch/diff3-style-merges-refactoring-2.diff

62 lines
1.8 KiB
Diff

---
patch.c | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
Index: b/patch.c
===================================================================
--- a/patch.c
+++ b/patch.c
@@ -288,32 +288,30 @@ main (int argc, char **argv)
newwhere = pch_newfirst() + last_offset;
if (skip_rest_of_patch) {
goto skip_hunk;
- }
- else if (!where
- || (where == 1 && pch_says_nonexistent (reverse) == 2
- && instat.st_size)) {
-
- if (where)
- say ("Patch attempted to create file %s, which already exists.\n",
- quotearg (inname));
+ } else if (where == 1 && pch_says_nonexistent (reverse) == 2
+ && instat.st_size) {
+ say ("Patch attempted to create file %s, "
+ "which already exists.\n", quotearg (inname));
goto skip_hunk;
- }
- else if (! apply_hunk (&outstate, where)) {
+ } else if (!where) {
goto skip_hunk;
} else {
- if (verbosity == VERBOSE
- || (verbosity != SILENT && (fuzz || last_offset))) {
- say ("Hunk #%d succeeded at %s", hunk,
- format_linenum (numbuf, newwhere));
- if (fuzz)
- say (" with fuzz %s", format_linenum (numbuf, fuzz));
- if (last_offset)
- say (" (offset %s line%s)",
- format_linenum (numbuf, last_offset),
- "s" + (last_offset == 1));
- say (".\n");
- }
+ if (!apply_hunk (&outstate, where))
+ goto skip_hunk;
+ }
+
+ if (verbosity == VERBOSE
+ || (verbosity != SILENT && (fuzz || last_offset))) {
+ say ("Hunk #%d succeeded at %s", hunk,
+ format_linenum (numbuf, newwhere));
+ if (fuzz)
+ say (" with fuzz %s", format_linenum (numbuf, fuzz));
+ if (last_offset)
+ say (" (offset %s line%s)",
+ format_linenum (numbuf, last_offset),
+ "s" + (last_offset == 1));
+ say (".\n");
}
continue;