Commit aa9f82475eebfaca6496836e1a4650f9c72c7567

Stefan Sperling 2019-08-05T10:45:52

simplify a block of code in check_out_of_date()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/lib/worktree.c b/lib/worktree.c
index d52d55e..3619401 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -3459,9 +3459,8 @@ check_out_of_date(const char *in_repo_path, unsigned char status,
 		err = got_object_id_by_path(&id, repo, head_commit_id,
 		    in_repo_path);
 		if (err) {
-			if (err->code != GOT_ERR_NO_TREE_ENTRY)
-				goto done;
-			err = got_error(ood_errcode);
+			if (err->code == GOT_ERR_NO_TREE_ENTRY)
+				err = got_error(ood_errcode);
 			goto done;
 		} else if (got_object_id_cmp(id, base_blob_id) != 0)
 			err = got_error(ood_errcode);