fix gitimport: use sh -c to set safe.directory before running gitimport

Anton Kaminsky28d agoe02f2d4caf41parent 8199678
1 file changed+6-30
api/src/routes/repos.ts
@@ -717,22 +717,10 @@
717717 await runDocker([
718718 "run", "--rm",
719719 "-v", "/data/grove:/data/grove",
720 "-e", "GIT_CONFIG_COUNT=1",
721 "-e", "GIT_CONFIG_KEY_0=safe.directory",
722 "-e", "GIT_CONFIG_VALUE_0=*",
723 "--entrypoint", "gitimport",
720 "--entrypoint", "sh",
724721 "grove/mononoke:latest",
725 "--repo-name", repoName,
726 "--config-path", MONONOKE_CONFIG_PATH,
727 "--local-configerator-path", `${DATA_DIR}/configerator`,
728 "--cache-mode", "disabled",
729 "--just-knobs-config-path", `${DATA_DIR}/justknobs.json`,
730 "--generate-bookmarks",
731 "--derive-hg",
732 "--git-command-path", "/usr/bin/git",
733 "--concurrency", "5",
734 bareRepo,
735 "full-repo",
722 "-c",
723 `git config --global --add safe.directory '*' && gitimport --repo-name ${repoName} --config-path ${MONONOKE_CONFIG_PATH} --local-configerator-path ${DATA_DIR}/configerator --cache-mode disabled --just-knobs-config-path ${DATA_DIR}/justknobs.json --generate-bookmarks --derive-hg --git-command-path /usr/bin/git --concurrency 5 ${bareRepo} full-repo`,
736724 ], (line) => {
737725 send("log", { step: "import", line });
738726 });
@@ -841,22 +829,10 @@
841829 await runDocker([
842830 "run", "--rm",
843831 "-v", "/data/grove:/data/grove",
844 "-e", "GIT_CONFIG_COUNT=1",
845 "-e", "GIT_CONFIG_KEY_0=safe.directory",
846 "-e", "GIT_CONFIG_VALUE_0=*",
847 "--entrypoint", "gitimport",
832 "--entrypoint", "sh",
848833 "grove/mononoke:latest",
849 "--repo-name", repoName,
850 "--config-path", MONONOKE_CONFIG_PATH,
851 "--local-configerator-path", `${DATA_DIR}/configerator`,
852 "--cache-mode", "disabled",
853 "--just-knobs-config-path", `${DATA_DIR}/justknobs.json`,
854 "--generate-bookmarks",
855 "--derive-hg",
856 "--git-command-path", "/usr/bin/git",
857 "--concurrency", "5",
858 bareRepo,
859 "full-repo",
834 "-c",
835 `git config --global --add safe.directory '*' && gitimport --repo-name ${repoName} --config-path ${MONONOKE_CONFIG_PATH} --local-configerator-path ${DATA_DIR}/configerator --cache-mode disabled --just-knobs-config-path ${DATA_DIR}/justknobs.json --generate-bookmarks --derive-hg --git-command-path /usr/bin/git --concurrency 5 ${bareRepo} full-repo`,
860836 ], (line) => {
861837 send("log", { step: "import", line });
862838 });
863839