Commit cc93ad16 by Pierre-Olivier Latour

Removed unnecessary condition

The variable noid is guaranteed to be zero at this point of the code path.
parent 35df76bd
...@@ -806,15 +806,12 @@ static int maybe_modified( ...@@ -806,15 +806,12 @@ static int maybe_modified(
* haven't calculated the OID of the new item, then calculate it now * haven't calculated the OID of the new item, then calculate it now
*/ */
if (modified_uncertain && git_oid_iszero(&nitem->id)) { if (modified_uncertain && git_oid_iszero(&nitem->id)) {
if (git_oid_iszero(&noid)) { const git_oid *update_check =
const git_oid *update_check = DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) ?
DIFF_FLAG_IS_SET(diff, GIT_DIFF_UPDATE_INDEX) ? &oitem->id : NULL;
&oitem->id : NULL; if ((error = git_diff__oid_for_entry(
&noid, diff, nitem, update_check)) < 0)
if ((error = git_diff__oid_for_entry( return error;
&noid, diff, nitem, update_check)) < 0)
return error;
}
/* if oid matches, then mark unmodified (except submodules, where /* if oid matches, then mark unmodified (except submodules, where
* the filesystem content may be modified even if the oid still * the filesystem content may be modified even if the oid still
......
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