summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6eb1b43)
raw | patch | inline | side by side (parent: 6eb1b43)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Tue, 2 Sep 2008 21:30:09 +0000 (23:30 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Sep 2008 02:06:17 +0000 (19:06 -0700) |
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
merge-recursive.c | patch | blob | history | |
merge-recursive.h | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index 457ad845f5c0196458bfba697faafae2d6b3a41a..5bb20aa8ba7a69b7f2f8404b6bcadbff97802755 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
static struct string_list current_file_set = {NULL, 0, 0, 1};
static struct string_list current_directory_set = {NULL, 0, 0, 1};
-static int call_depth = 0;
static struct strbuf obuf = STRBUF_INIT;
static int show(struct merge_options *o, int v)
{
- return (!call_depth && o->verbosity >= v) || o->verbosity >= 5;
+ return (!o->call_depth && o->verbosity >= v) || o->verbosity >= 5;
}
static void flush_output(void)
if (!show(o, v))
return;
- strbuf_grow(&obuf, call_depth * 2 + 2);
- memset(obuf.buf + obuf.len, ' ', call_depth * 2);
- strbuf_setlen(&obuf, obuf.len + call_depth * 2);
+ strbuf_grow(&obuf, o->call_depth * 2 + 2);
+ memset(obuf.buf + obuf.len, ' ', o->call_depth * 2);
+ strbuf_setlen(&obuf, obuf.len + o->call_depth * 2);
va_start(ap, fmt);
len = vsnprintf(obuf.buf + obuf.len, strbuf_avail(&obuf), fmt, ap);
flush_output();
}
-static void output_commit_title(struct commit *commit)
+static void output_commit_title(struct merge_options *o, struct commit *commit)
{
int i;
flush_output();
- for (i = call_depth; i--;)
+ for (i = o->call_depth; i--;)
fputs(" ", stdout);
if (commit->util)
printf("virtual %s\n", (char *)commit->util);
if (show(o, 4)) {
output(o, 4, "Merging:");
- output_commit_title(h1);
- output_commit_title(h2);
+ output_commit_title(o, h1);
+ output_commit_title(o, h2);
}
if (!ca) {
if (show(o, 5)) {
output(o, 5, "found %u common ancestor(s):", commit_list_count(ca));
for (iter = ca; iter; iter = iter->next)
- output_commit_title(iter->item);
+ output_commit_title(o, iter->item);
}
merged_common_ancestors = pop_commit(&ca);
for (iter = ca; iter; iter = iter->next) {
const char *saved_b1, *saved_b2;
- call_depth++;
+ o->call_depth++;
/*
* When the merge fails, the result contains files
* with conflict markers. The cleanness flag is
NULL, &merged_common_ancestors);
o->branch1 = saved_b1;
o->branch2 = saved_b2;
- call_depth--;
+ o->call_depth--;
if (!merged_common_ancestors)
die("merge returned no commit");
}
discard_cache();
- if (!call_depth) {
+ if (!o->call_depth) {
read_cache();
index_only = 0;
} else
diff --git a/merge-recursive.h b/merge-recursive.h
index 72f0a2895d15124edb778cdae93ffe6c7d985f12..4f5537417e3b290544138edaec9c32469c19e477 100644 (file)
--- a/merge-recursive.h
+++ b/merge-recursive.h
int verbosity;
int diff_rename_limit;
int merge_rename_limit;
+ int call_depth;
};
/* merge_trees() but with recursive ancestor consolidation */