summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9c7c43)
raw | patch | inline | side by side (parent: a9c7c43)
author | Junio C Hamano <gitster@pobox.com> | |
Sat, 30 Jan 2010 20:08:26 +0000 (12:08 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 30 Jan 2010 21:56:56 +0000 (13:56 -0800) |
Even when the environment was given for the top-level process, checking
in the submodule work tree should use the index file associated with the
work tree of the submodule. Do not export it to the environment.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
in the submodule work tree should use the index file associated with the
work tree of the submodule. Do not export it to the environment.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c | patch | blob | history |
diff --git a/submodule.c b/submodule.c
index ca0527fbcbdf4838a50956704148744630b65775..6f7c21090bd3e85bcadb9712c3ac46e711762ab0 100644 (file)
--- a/submodule.c
+++ b/submodule.c
"--porcelain",
NULL,
};
- char *env[3];
+ char *env[4];
struct strbuf buf = STRBUF_INIT;
strbuf_addf(&buf, "%s/.git/", path);
env[0] = strbuf_detach(&buf, NULL);
strbuf_addf(&buf, "GIT_DIR=%s/.git", path);
env[1] = strbuf_detach(&buf, NULL);
- env[2] = NULL;
+ strbuf_addf(&buf, "GIT_INDEX_FILE");
+ env[2] = strbuf_detach(&buf, NULL);
+ env[3] = NULL;
memset(&cp, 0, sizeof(cp));
cp.argv = argv;
free(env[0]);
free(env[1]);
+ free(env[2]);
strbuf_release(&buf);
return len != 0;
}