summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f4b6c6b)
raw | patch | inline | side by side (parent: f4b6c6b)
author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 14 Jan 2007 05:28:33 +0000 (00:28 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 14 Jan 2007 20:20:39 +0000 (12:20 -0800) |
Because the output_indent always matches the call_depth value
there is no reason to pass around the call_depth to the merge
function during each recursive invocation.
This is a simple refactoring that will make the code easier to
follow later on as I start to add output verbosity controls.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
there is no reason to pass around the call_depth to the merge
function during each recursive invocation.
This is a simple refactoring that will make the code easier to
follow later on as I start to add output verbosity controls.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
merge-recursive.c | patch | blob | history |
diff --git a/merge-recursive.c b/merge-recursive.c
index b4acbb74080ad308625fcff09be0af51c2b4111d..8738f090c30008f3ebf8accb9831012bcfac001e 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
static struct path_list current_file_set = {NULL, 0, 0, 1};
static struct path_list current_directory_set = {NULL, 0, 0, 1};
-static int output_indent = 0;
+static int call_depth = 0;
static void output(const char *fmt, ...)
{
va_list args;
int i;
- for (i = output_indent; i--;)
+ for (i = call_depth; i--;)
fputs(" ", stdout);
va_start(args, fmt);
vfprintf(stdout, fmt, args);
static void output_commit_title(struct commit *commit)
{
int i;
- for (i = output_indent; i--;)
+ for (i = call_depth; i--;)
fputs(" ", stdout);
if (commit->util)
printf("virtual %s\n", (char *)commit->util);
struct commit *h2,
const char *branch1,
const char *branch2,
- int call_depth /* =0 */,
struct commit_list *ca,
struct commit **result)
{
}
for (iter = ca; iter; iter = iter->next) {
- output_indent = call_depth + 1;
+ call_depth++;
/*
* When the merge fails, the result contains files
* with conflict markers. The cleanness flag is
merge(merged_common_ancestors, iter->item,
"Temporary merge branch 1",
"Temporary merge branch 2",
- call_depth + 1,
NULL,
&merged_common_ancestors);
- output_indent = call_depth;
+ call_depth--;
if (!merged_common_ancestors)
die("merge returned no commit");
}
discard_cache();
- if (call_depth == 0) {
+ if (!call_depth) {
read_cache();
index_only = 0;
} else
struct commit *ancestor = get_ref(bases[i]);
ca = commit_list_insert(ancestor, &ca);
}
- clean = merge(h1, h2, branch1, branch2, 0, ca, &result);
+ clean = merge(h1, h2, branch1, branch2, ca, &result);
if (active_cache_changed &&
(write_cache(index_fd, active_cache, active_nr) ||