#include "dir.h"
#include "resolve-undo.h"
#include "ll-merge.h"
+#include "attr.h"
/* if rerere_enabled == -1, fall back to detection of .git/rr-cache */
static int rerere_enabled = -1;
{
int hunk_no = 0;
struct rerere_io_file io;
- int marker_size = 7;
+ int marker_size = ll_merge_marker_size(path);
memset(&io, 0, sizeof(io));
io.io.getline = rerere_file_getline;
struct cache_entry *ce;
int pos, len, i, hunk_no;
struct rerere_io_mem io;
- int marker_size = 7;
+ int marker_size = ll_merge_marker_size(path);
/*
* Reproduce the conflicted merge in-core
for (i = 0; i < 3; i++)
free(mmfile[i].ptr);
- memset(&io, 0, sizeof(&io));
+ memset(&io, 0, sizeof(io));
io.io.getline = rerere_mem_getline;
if (output)
io.io.output = fopen(output, "w");
return 1;
}
-int setup_rerere(struct string_list *merge_rr)
+int setup_rerere(struct string_list *merge_rr, int flags)
{
int fd;
if (!is_rerere_enabled())
return -1;
+ if (flags & (RERERE_AUTOUPDATE|RERERE_NOAUTOUPDATE))
+ rerere_autoupdate = !!(flags & RERERE_AUTOUPDATE);
merge_rr_path = git_pathdup("MERGE_RR");
fd = hold_lock_file_for_update(&write_lock, merge_rr_path,
LOCK_DIE_ON_ERROR);
return fd;
}
-int rerere(void)
+int rerere(int flags)
{
struct string_list merge_rr = { NULL, 0, 0, 1 };
int fd;
- fd = setup_rerere(&merge_rr);
+ fd = setup_rerere(&merge_rr, flags);
if (fd < 0)
return 0;
return do_plain_rerere(&merge_rr, fd);
if (read_cache() < 0)
return error("Could not read index");
- fd = setup_rerere(&merge_rr);
+ fd = setup_rerere(&merge_rr, RERERE_NOAUTOUPDATE);
unmerge_cache(pathspec);
find_conflict(&conflict);