From: Jeff King Date: Thu, 03 Aug 2006 20:29:57 GMT Subject: Re: Regression: git-commit no longer works from within subdirectories Message-ID: <20060803202957.GA26838@coredump.intra.peff.net> In-Reply-To: <44D23B1C.80704@codeweavers.com> On Thu, Aug 03, 2006 at 07:06:20PM +0100, Robert Shearman wrote: > It fails with a confusing message when you are in a subdirectory: > rob@saturn:~/wine-git/dlls/msi$ git commit action.c > usage: git-read-tree ( | [[-m [--aggressive] | --reset | > --prefix=] [-u | -i]] [ []]) The culprit is the recent changes to the builtins. cmd_read_tree now takes an extra parameter 'prefix' which shadows the global declaration in builtin-read-tree.c (and has a completely different meaning). The one-liner below fixes it (though style-wise, you may prefer to rename the shadowed variable). -Peff --- diff --git a/builtin-read-tree.c b/builtin-read-tree.c index 49c10bf..8e3b04e 100644 --- a/builtin-read-tree.c +++ b/builtin-read-tree.c @@ -870,7 +870,7 @@ static const char read_tree_usage[] = "g static struct lock_file lock_file; -int cmd_read_tree(int argc, const char **argv, const char *prefix) +int cmd_read_tree(int argc, const char **argv, const char *git_prefix) { int i, newfd, stage = 0; unsigned char sha1[20];