Git-merge-file is documented to return one of three exit codes: - zero means the merge was successful - a negative number means an error occurred - a positive number indicates the number of conflicts Unfortunately, this all gets stuffed into an 8-bit return code. Which means that if you have 256 conflicts, this wraps to zero, and the merge appears to succeed (and commits a blob full of conflict-marker cruft!). This patch clamps the return value to a maximum of 127, which we should be able to safely represent everywhere. This also leaves 128-255 for other values. Shells (and some parts of git) will typically represent signal death as 128 plus the signal number. And negative values are typically coerced to an 8-bit unsigned value (so "return -1" ends up as 255). Technically negative returns have the same problem (e.g., "-256" wraps back to 0), but this is not a problem in practice, as the only negative value we use is "-1". Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com> |
||
|---|---|---|
| .. | ||
| add.c | ||
| annotate.c | ||
| apply.c | ||
| archive.c | ||
| bisect--helper.c | ||
| blame.c | ||
| branch.c | ||
| bundle.c | ||
| cat-file.c | ||
| check-attr.c | ||
| check-ignore.c | ||
| check-mailmap.c | ||
| check-ref-format.c | ||
| checkout-index.c | ||
| checkout.c | ||
| clean.c | ||
| clone.c | ||
| column.c | ||
| commit-tree.c | ||
| commit.c | ||
| config.c | ||
| count-objects.c | ||
| credential.c | ||
| describe.c | ||
| diff-files.c | ||
| diff-index.c | ||
| diff-tree.c | ||
| diff.c | ||
| fast-export.c | ||
| fetch-pack.c | ||
| fetch.c | ||
| fmt-merge-msg.c | ||
| for-each-ref.c | ||
| fsck.c | ||
| gc.c | ||
| get-tar-commit-id.c | ||
| grep.c | ||
| hash-object.c | ||
| help.c | ||
| index-pack.c | ||
| init-db.c | ||
| log.c | ||
| ls-files.c | ||
| ls-remote.c | ||
| ls-tree.c | ||
| mailinfo.c | ||
| mailsplit.c | ||
| merge-base.c | ||
| merge-file.c | ||
| merge-index.c | ||
| merge-ours.c | ||
| merge-recursive.c | ||
| merge-tree.c | ||
| merge.c | ||
| mktag.c | ||
| mktree.c | ||
| mv.c | ||
| name-rev.c | ||
| notes.c | ||
| pack-objects.c | ||
| pack-redundant.c | ||
| pack-refs.c | ||
| patch-id.c | ||
| prune-packed.c | ||
| prune.c | ||
| push.c | ||
| read-tree.c | ||
| receive-pack.c | ||
| reflog.c | ||
| remote-ext.c | ||
| remote-fd.c | ||
| remote.c | ||
| repack.c | ||
| replace.c | ||
| rerere.c | ||
| reset.c | ||
| rev-list.c | ||
| rev-parse.c | ||
| revert.c | ||
| rm.c | ||
| send-pack.c | ||
| shortlog.c | ||
| show-branch.c | ||
| show-ref.c | ||
| stripspace.c | ||
| symbolic-ref.c | ||
| tag.c | ||
| unpack-file.c | ||
| unpack-objects.c | ||
| update-index.c | ||
| update-ref.c | ||
| update-server-info.c | ||
| upload-archive.c | ||
| var.c | ||
| verify-pack.c | ||
| verify-tag.c | ||
| write-tree.c | ||