setup.c: mention unresolved problems
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 13 Mar 2017 20:12:18 +0000 (21:12 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Mar 2017 21:24:16 +0000 (14:24 -0700)
During the review of the `early-config` patch series, two issues
have been identified that have been with us forever. Mark the
identified problems for later so that we do not forget them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
setup.c
diff --git a/setup.c b/setup.c
index f26094e9ade1f4c8871f80cdc458f40b1448e68e..98b8dee8b822f200c283085c36ea36b4ad54e354 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -531,6 +531,7 @@ const char *read_gitfile_gently(const char *path, int *return_error_code)
        ssize_t len;
 
        if (stat(path, &st)) {
+               /* NEEDSWORK: discern between ENOENT vs other errors */
                error_code = READ_GITFILE_ERR_STAT_FAILED;
                goto cleanup_return;
        }
@@ -902,6 +903,7 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
                if (!gitdirenv) {
                        if (die_on_error ||
                            error_code == READ_GITFILE_ERR_NOT_A_FILE) {
+                               /* NEEDSWORK: fail if .git is not file nor dir */
                                if (is_git_directory(dir->buf))
                                        gitdirenv = DEFAULT_GIT_DIR_ENVIRONMENT;
                        } else if (error_code != READ_GITFILE_ERR_STAT_FAILED)