}
- init_revisions(&rev);
+ init_revisions(&rev, setup_git_directory());
rev.remove_empty_trees = 1;
rev.topo_order = 1;
rev.prune_fn = simplify_commit;
struct rev_info rev;
int silent = 0;
- init_revisions(&rev);
+ init_revisions(&rev, setup_git_directory());
git_config(git_default_config); /* no "diff" UI options */
rev.abbrev = 0;
int cached = 0;
int i;
- init_revisions(&rev);
+ init_revisions(&rev, setup_git_directory());
git_config(git_default_config); /* no "diff" UI options */
rev.abbrev = 0;
static struct rev_info *opt = &log_tree_opt;
int read_stdin = 0;
- init_revisions(opt);
+ init_revisions(opt, setup_git_directory());
git_config(git_default_config); /* no "diff" UI options */
nr_sha1 = 0;
opt->abbrev = 0;
struct rev_info rev;
struct object_array_entry ent[100];
int ents = 0, blobs = 0, paths = 0;
- const char *path = NULL;
+ const char *path = NULL, *prefix;
struct blobinfo blob[2];
/*
* Other cases are errors.
*/
- init_revisions(&rev);
+ prefix = setup_git_directory();
git_config(git_diff_ui_config);
- diff_setup(&rev.diffopt);
+ init_revisions(&rev, prefix);
argc = setup_revisions(argc, argv, &rev, NULL);
if (!rev.diffopt.output_format) {
const char *sep = "";
unsigned char head_sha1[20];
const char *head, *current_branch;
+ const char *prefix = setup_git_directory();
git_config(fmt_merge_msg_config);
struct rev_info rev;
head = lookup_commit(head_sha1);
- init_revisions(&rev);
+ init_revisions(&rev, prefix);
rev.commit_format = CMIT_FMT_ONELINE;
rev.ignore_merges = 1;
rev.limited = 1;
int cmd_whatchanged(int argc, const char **argv, char **envp)
{
struct rev_info rev;
+ const char *prefix = setup_git_directory();
- init_revisions(&rev);
git_config(git_diff_ui_config);
- diff_setup(&rev.diffopt);
+ init_revisions(&rev, prefix);
rev.diff = 1;
rev.diffopt.recursive = 1;
rev.simplify_history = 0;
int cmd_show(int argc, const char **argv, char **envp)
{
struct rev_info rev;
+ const char *prefix = setup_git_directory();
- init_revisions(&rev);
git_config(git_diff_ui_config);
- diff_setup(&rev.diffopt);
+ init_revisions(&rev, prefix);
rev.diff = 1;
rev.diffopt.recursive = 1;
rev.combine_merges = 1;
int cmd_log(int argc, const char **argv, char **envp)
{
struct rev_info rev;
+ const char *prefix = setup_git_directory();
- init_revisions(&rev);
git_config(git_diff_ui_config);
- diff_setup(&rev.diffopt);
+ init_revisions(&rev, prefix);
rev.always_show_header = 1;
cmd_log_init(argc, argv, envp, &rev);
return cmd_log_walk(&rev);
struct object *o1, *o2;
unsigned flags1, flags2;
unsigned char sha1[20];
+ const char *prefix = setup_git_directory();
if (rev->pending.nr != 2)
die("Need exactly one range.");
die("diff_setup_done failed");
/* given a range a..b get all patch ids for b..a */
- init_revisions(&check_rev);
+ init_revisions(&check_rev, prefix);
o1->flags ^= UNINTERESTING;
o2->flags ^= UNINTERESTING;
add_pending_object(&check_rev, o1, "o1");
char *add_signoff = NULL;
char message_id[1024];
char ref_message_id[1024];
+ const char *prefix = setup_git_directory();
git_config(git_format_config);
- init_revisions(&rev);
+ init_revisions(&rev, prefix);
rev.commit_format = CMIT_FMT_EMAIL;
rev.verbose_header = 1;
rev.diff = 1;
* Set up revision parsing, and mark us as being interested
* in all object types, not just commits.
*/
- init_revisions(&revs);
+ init_revisions(&revs, setup_git_directory());
revs.tag_objects = 1;
revs.blob_objects = 1;
revs.tree_objects = 1;
struct commit_list *list;
int i;
- init_revisions(&revs);
+ init_revisions(&revs, setup_git_directory());
revs.abbrev = 0;
revs.commit_format = CMIT_FMT_UNSPECIFIED;
argc = setup_revisions(argc, argv, &revs, NULL);
commit_argv[3] = old_sha1_hex;
commit_argc++;
}
- init_revisions(&revs);
+ init_revisions(&revs, setup_git_directory());
setup_revisions(commit_argc, commit_argv, &revs, NULL);
free(new_sha1_hex);
if (old_sha1_hex) {
return 1;
}
-void init_revisions(struct rev_info *revs)
+void init_revisions(struct rev_info *revs, const char *prefix)
{
memset(revs, 0, sizeof(*revs));
revs->pruning.change = file_change;
revs->lifo = 1;
revs->dense = 1;
- revs->prefix = setup_git_directory();
+ revs->prefix = prefix;
revs->max_age = -1;
revs->min_age = -1;
revs->max_count = -1;
extern int rev_same_tree_as_empty(struct rev_info *, struct tree *t1);
extern int rev_compare_tree(struct rev_info *, struct tree *t1, struct tree *t2);
-extern void init_revisions(struct rev_info *revs);
+extern void init_revisions(struct rev_info *revs, const char *prefix);
extern int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def);
extern void prepare_revision_walk(struct rev_info *revs);
extern struct commit *get_revision(struct rev_info *revs);