Skip to content

Commit fcd1b78

Browse files
committed
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.
1 parent f80852a commit fcd1b78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/merge_file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ static int merge_file__xdiff(
134134

135135
path = git_merge_file__best_path(
136136
ancestor ? ancestor->path : NULL,
137-
ours ? ours->path : NULL,
138-
theirs ? theirs->path : NULL);
137+
ours->path,
138+
theirs->path);
139139

140140
if (path != NULL && (out->path = git__strdup(path)) == NULL) {
141141
error = -1;
@@ -147,8 +147,8 @@ static int merge_file__xdiff(
147147
out->len = mmbuffer.size;
148148
out->mode = git_merge_file__best_mode(
149149
ancestor ? ancestor->mode : 0,
150-
ours ? ours->mode : 0,
151-
theirs ? theirs->mode : 0);
150+
ours->mode,
151+
theirs->mode);
152152

153153
done:
154154
if (error < 0)

0 commit comments

Comments
 (0)