diff --git a/compat/mingw.c b/compat/mingw.c index 29d3f09768c29a..6c2bb00cfacfe7 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -2771,9 +2771,7 @@ int is_path_owned_by_current_sid(const char *path, struct strbuf *report) DACL_SECURITY_INFORMATION, &sid, NULL, NULL, NULL, &descriptor); - if (err != ERROR_SUCCESS) - error(_("failed to get owner for '%s' (%ld)"), path, err); - else if (sid && IsValidSid(sid)) { + if (err == ERROR_SUCCESS && sid && IsValidSid(sid)) { /* Now, verify that the SID matches the current user's */ static PSID current_user_sid; BOOL is_member;