On Fri, Apr 29, 2011 at 07:19:09PM +0200, Martin von Zweigbergk wrote: > On Apr 29, 2011 12:41 AM, "Jeff King" <peff@xxxxxxxx> wrote: > > > > - git checkout-index -f --stage=2 -- "$4" && cat "$src1" >"$4" > > + git checkout-index -f --stage=2 -- "$4" && > > + cat "$src1" >"${GIT_WORK_TREE:+$GIT_WORK_TREE/}$4" || > > + exit 1 > > Would "git rev-parse --show-toplevel" be better here? Does it work with > core.worktree etc otherwise? (Maybe git-sh-setup sets the env var?) Good catch. I believe the git wrapper will convert "git --work-tree" into an environment variable, but the config seems to be handled separately. and either way, I think we technically still support calling "git-merge-one-file" directly without the git wrapper. Thinking on it more, it probably makes more sense to "cd_to_toplevel" via git-sh-setup. It seems pretty clear to me the original script was written with the expectation of being at the top of the working tree (and that is certainly where it ends up when called via git-merge-octopus and git-merge-resolve). Let me extend the tests a bit and roll a new series. -Peff -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html