Commit Diff


commit - 5a20d08d6546fa260cd5ce2ed01e438f5ec35f41
commit + 916237f3fd368a7d5714dfd3b8a755d4b1dae19d
blob - 610c0eb85518f221f5f8ae1907397ddd07bea422
blob + 0b4571401cfdddef043be11cce960c58beae2802
--- lib/worktree.c
+++ lib/worktree.c
@@ -3559,9 +3559,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)
@@ -3575,6 +3572,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);