#include "builtin.h"
#include "trace.h"
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
{
trace_printf(_("cmd_walken incoming...\n"));
return 0;
Also add the relevant line in `builtin.h` near `cmd_whatchanged()`:
----
-int cmd_walken(int argc, const char **argv, const char *prefix);
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo);
----
Include the command in `git.c` in `commands[]` near the entry for `whatchanged`,
Next, we should have a look at any relevant configuration settings (i.e.,
settings readable and settable from `git config`). This is done by providing a
-callback to `git_config()`; within that callback, you can also invoke methods
+callback to `repo_config()`; within that callback, you can also invoke methods
from other components you may need that need to intercept these options. Your
callback will be invoked once per each configuration value which Git knows about
(global, local, worktree, etc.).
}
----
-Make sure to invoke `git_config()` with it in your `cmd_walken()`:
+Make sure to invoke `repo_config()` with it in your `cmd_walken()`:
----
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
{
...
- git_config(git_walken_config, NULL);
+ repo_config(repo, git_walken_config, NULL);
...
}
...
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
{
/* This can go wherever you like in your declarations.*/
struct rev_info rev;
...
- /* This should go after the git_config() call. */
- repo_init_revisions(the_repository, &rev, prefix);
+ /* This should go after the repo_config() call. */
+ repo_init_revisions(repo, &rev, prefix);
...
}
`repo_init_revisions()`:
----
-int cmd_walken(int argc, const char **argv, const char *prefix)
+int cmd_walken(int argc, const char **argv, const char *prefix, struct repository *repo)
{
...