summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9b864e7)
raw | patch | inline | side by side (parent: 9b864e7)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sat, 22 Nov 2008 23:13:00 +0000 (00:13 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Nov 2008 03:55:52 +0000 (19:55 -0800) |
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
ll-merge.c | patch | blob | history | |
merge-recursive.c | patch | blob | history |
diff --git a/ll-merge.c b/ll-merge.c
index 4a716146f67c5921646bcde0e8499fb37b993636..fa2ca5250c75a0d335570a3a3c71b20ebd0b42fa 100644 (file)
--- a/ll-merge.c
+++ b/ll-merge.c
#include "attr.h"
#include "xdiff-interface.h"
#include "run-command.h"
-#include "interpolate.h"
#include "ll-merge.h"
struct ll_merge_driver;
int virtual_ancestor)
{
char temp[3][50];
- char cmdbuf[2048];
- struct interp table[] = {
- { "%O" },
- { "%A" },
- { "%B" },
+ struct strbuf cmd = STRBUF_INIT;
+ struct strbuf_expand_dict_entry dict[] = {
+ { "O", temp[0] },
+ { "A", temp[1] },
+ { "B", temp[2] },
+ { NULL }
};
struct child_process child;
const char *args[20];
create_temp(src1, temp[1]);
create_temp(src2, temp[2]);
- interp_set_entry(table, 0, temp[0]);
- interp_set_entry(table, 1, temp[1]);
- interp_set_entry(table, 2, temp[2]);
-
- interpolate(cmdbuf, sizeof(cmdbuf), fn->cmdline, table, 3);
+ strbuf_expand(&cmd, fn->cmdline, strbuf_expand_dict_cb, &dict);
memset(&child, 0, sizeof(child));
child.argv = args;
args[0] = "sh";
args[1] = "-c";
- args[2] = cmdbuf;
+ args[2] = cmd.buf;
args[3] = NULL;
status = run_command(&child);
bad:
for (i = 0; i < 3; i++)
unlink(temp[i]);
+ strbuf_release(&cmd);
return status;
}
diff --git a/merge-recursive.c b/merge-recursive.c
index 7472d3ecc9b8412a697a64c1307259a104e0abf9..0e988f2a0081803f5ee30adbf7a548c2c8a00a05 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
#include "string-list.h"
#include "xdiff-interface.h"
#include "ll-merge.h"
-#include "interpolate.h"
#include "attr.h"
#include "merge-recursive.h"
#include "dir.h"