Commits

Yuya Nishihara committed 4c539ae

hgclient: start background cmdserver at rootdir

It's simple and reasonable than starting at HOME.

Comments (0)

Files changed (1)

     unsetenv("HGPLAINEXCEPT");
     const char *hgcmd = getenv("HG");
     if (!hgcmd) hgcmd = "hg";
-    const char *homedir = getenv("HOME");
-    if (!homedir) homedir = "/";
     const char *cmdopts = getenv("CHGCMDSERVEROPTS");
     if (!cmdopts) cmdopts = "";
     char cmdline[1024];
     // TODO escape?
     int r = snprintf(cmdline, sizeof(cmdline),
-             "'%s' serve --cwd '%s' --cmdserver unix --daemon --port '%s' "
+             "'%s' serve --cwd / --cmdserver unix --daemon --port '%s' "
              "--config extensions.chgsupport= "
              "--config color.mode=chgauto "
-             "%s", hgcmd, homedir, sockname, cmdopts);
+             "%s", hgcmd, sockname, cmdopts);
     if (r < 0 || (size_t) r >= sizeof(cmdline))
         abortmsg("failed to construct cmdline string (r = %d)", r);
     r = execlp("/bin/sh", "/bin/sh", "-c", cmdline, NULL);