Commit fcd1b786 by Patrick Steinhardt

merge_file: do not unnecessarily check ours/theirs for NULL

The `merge_file__xdiff` function checks if either `ours` or
`theirs` is `NULL`. The function is to be called with existing
files, though, and in fact already unconditionally dereferences
both pointers.

Remove the unnecessary check to silence warnings.
parent f80852af
...@@ -134,8 +134,8 @@ static int merge_file__xdiff( ...@@ -134,8 +134,8 @@ static int merge_file__xdiff(
path = git_merge_file__best_path( path = git_merge_file__best_path(
ancestor ? ancestor->path : NULL, ancestor ? ancestor->path : NULL,
ours ? ours->path : NULL, ours->path,
theirs ? theirs->path : NULL); theirs->path);
if (path != NULL && (out->path = git__strdup(path)) == NULL) { if (path != NULL && (out->path = git__strdup(path)) == NULL) {
error = -1; error = -1;
...@@ -147,8 +147,8 @@ static int merge_file__xdiff( ...@@ -147,8 +147,8 @@ static int merge_file__xdiff(
out->len = mmbuffer.size; out->len = mmbuffer.size;
out->mode = git_merge_file__best_mode( out->mode = git_merge_file__best_mode(
ancestor ? ancestor->mode : 0, ancestor ? ancestor->mode : 0,
ours ? ours->mode : 0, ours->mode,
theirs ? theirs->mode : 0); theirs->mode);
done: done:
if (error < 0) if (error < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment