summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Olivier Latour <pol@mac.com>2015-04-15 15:27:59 -0700
committerPierre-Olivier Latour <pol@mac.com>2015-04-15 15:27:59 -0700
commitcc93ad16502ea09b1923ca9eb1b291ced646cf38 (patch)
tree1fa49c749cae40a3d272bbae93647d96bb2d14a7
parent35df76bdd9536f1b02a04908871904da11292292 (diff)
downloadlibgit2-cc93ad16502ea09b1923ca9eb1b291ced646cf38.tar.gz
Removed unnecessary condition
The variable noid is guaranteed to be zero at this point of the code path.
-rw-r--r--src/diff.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/diff.c b/src/diff.c
index 20f8f74c5..ba8a1b884 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -806,15 +806,12 @@ static int maybe_modified(
* haven't calculated the OID of the new item, then calculate it now
*/
if (modified_uncertain && git_oid_iszero(&nitem->id)) {
- if (git_oid_iszero(&noid)) {
- const git_oid *update_check =
- DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) ?
- &oitem->id : NULL;
-
- if ((error = git_diff__oid_for_entry(
- &noid, diff, nitem, update_check)) < 0)
- return error;
- }
+ const git_oid *update_check =
+ DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) ?
+ &oitem->id : NULL;
+ if ((error = git_diff__oid_for_entry(
+ &noid, diff, nitem, update_check)) < 0)
+ return error;
/* if oid matches, then mark unmodified (except submodules, where
* the filesystem content may be modified even if the oid still