Commit Diff


commit - 8f666e6727a955b77826be69882851792a8a1bac
commit + fe1d86855517f122428c120d5c41f4af72120637
blob - 2f9c113310bf9ff778c1c37fce014a3a4b984b2f
blob + e1b7e4afe3cfeb497fdb514b0e081d0684796aa8
--- lib/worktree.c
+++ lib/worktree.c
@@ -3557,9 +3557,6 @@ report_single_file_status(const char *path, const char
 {
 	struct got_fileindex_entry *ie;
 	struct stat sb;
-
-	if (!no_ignores && match_ignores(ignores, path))
-		return NULL;
 
 	ie = got_fileindex_entry_get(fileindex, path, strlen(path));
 	if (ie)
@@ -3573,6 +3570,9 @@ report_single_file_status(const char *path, const char
 		    GOT_STATUS_NO_CHANGE, path, NULL, NULL, NULL, -1, NULL);
 	}
 
+	if (!no_ignores && match_ignores(ignores, path))
+		return NULL;
+
 	if (S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode))
 		return (*status_cb)(status_arg, GOT_STATUS_UNVERSIONED,
 		    GOT_STATUS_NO_CHANGE, path, NULL, NULL, NULL, -1, NULL);