git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] merge-recursive: fix subtree merge

From
Miklos Vajna <vmiklos@frugalware.org>
Date
Aug 30, 2008, 15:42 UTC
Message-ID
<1220110929-6803-1-git-send-email-vmiklos@frugalware.org>
In-Reply-To
<1219674357-31000-1-git-send-email-vmiklos@frugalware.org>

We should decide if we do a subtree merge based on the merge_options struct, not based on the global variable, which should not even exist at all.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
---
On Mon, Aug 25, 2008 at 04:25:57PM +0200, Miklos Vajna <vmiklos@frugalware.org> wrote:
> It also takes care of subtree merge, output buffering, verbosity, and
> rename limits - these were global variables till now in
> merge-recursive.c.

Actually subtree_merge was not used from the struct merge_options, here is the fix.

 merge-recursive.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 3a38cc6..457ad84 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -20,8 +20,6 @@
 #include "attr.h"
 #include "merge-recursive.h"
 
-static int subtree_merge;
-
 static struct tree *shift_tree_object(struct tree *one, struct tree *two)
 {
 	unsigned char shifted[20];
@@ -1152,7 +1150,7 @@ int merge_trees(struct merge_options *o,
 {
 	int code, clean;
 
-	if (subtree_merge) {
+	if (o->subtree_merge) {
 		merge = shift_tree_object(head, merge);
 		common = shift_tree_object(head, common);
 	}
-- 
1.6.0
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 20 in “What's cooking in git.git (Aug 2008, #05; Tue, 19)”
  1. Junio C HamanoAug 19, 2008
  2. Johannes SixtAug 19, 2008
  3. Andreas FärberAug 19, 2008
  4. Miklos VajnaAug 19, 2008
  5. Junio C HamanoAug 19, 2008
  6. Miklos VajnaAug 19, 2008
  7. Junio C HamanoAug 19, 2008
  8. Miklos VajnaAug 20, 2008
  9. merge-recursive: introduce merge_optionsMiklos Vajna, Aug 25, 2008
  10. Junio C HamanoAug 25, 2008
  11. merge-recursive: introduce merge_optionsMiklos Vajna, Aug 25, 2008
  12. Junio C HamanoAug 28, 2008
  13. merge-recursive: fix subtree mergeMiklos Vajna, Aug 30, 2008
  14. Junio C HamanoAug 30, 2008
  15. Junio C HamanoAug 30, 2008
  16. Miklos VajnaAug 31, 2008
  17. Miklos VajnaSep 1, 2008
  18. builtin-revert: use merge_recursive_generic()Miklos Vajna, Sep 1, 2008
  19. Junio C HamanoSep 2, 2008
  20. Junio C HamanoSep 2, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.