From: Junio C Hamano Date: Fri, 03 Feb 2012 00:47:31 GMT Subject: Re: Alternates corruption issue Message-ID: <7vzkd0u4ik.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120202215913.GA26727@sigill.intra.peff.net> Jeff King writes: > @@ -324,8 +324,11 @@ const char *enter_repo(const char *path, int strict) > return NULL; > len = strlen(used_path); > for (i = 0; suffix[i]; i++) { > + struct stat st; > strcpy(used_path + len, suffix[i]); > - if (!access(used_path, F_OK)) { > + if (!stat(used_path, &st) && > + (S_ISREG(st.st_mode) || > + (S_ISDIR(st.st_mode) && is_git_directory(used_path)))) { Hmm, how would this change interact with > strcat(validated_path, suffix[i]); > break; > } gitfile = read_gitfile(used_path); that appear after the context in the patch?