diff options
| author | Patrick Steinhardt <ps@pks.im> | 2016-05-02 14:46:14 +0200 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2016-05-02 17:45:23 +0200 |
| commit | fcd1b786017471a7cbf97b1065a00f0551d47115 (patch) | |
| tree | bc78ab9fa039709487ad332b8d13b5556e74b2ed /src | |
| parent | f80852af807ae40bfc56e3285dda460873ecc9f9 (diff) | |
| download | libgit2-fcd1b786017471a7cbf97b1065a00f0551d47115.tar.gz | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/merge_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/merge_file.c b/src/merge_file.c index 731f4b724..3f14a4f63 100644 --- a/src/merge_file.c +++ b/src/merge_file.c @@ -134,8 +134,8 @@ static int merge_file__xdiff( path = git_merge_file__best_path( ancestor ? ancestor->path : NULL, - ours ? ours->path : NULL, - theirs ? theirs->path : NULL); + ours->path, + theirs->path); if (path != NULL && (out->path = git__strdup(path)) == NULL) { error = -1; @@ -147,8 +147,8 @@ static int merge_file__xdiff( out->len = mmbuffer.size; out->mode = git_merge_file__best_mode( ancestor ? ancestor->mode : 0, - ours ? ours->mode : 0, - theirs ? theirs->mode : 0); + ours->mode, + theirs->mode); done: if (error < 0) |
