Merge branch 'jc/cache-unmerge'
* jc/cache-unmerge: rerere forget path: forget recorded resolution rerere: refactor rerere logic to make it independent from I/O rerere: remove silly 1024-byte line limit resolve-undo: teach "update-index --unresolve" to use resolve-undo info resolve-undo: "checkout -m path" uses resolve-undo information resolve-undo: allow plumbing to clear the information resolve-undo: basic tests resolve-undo: record resolved conflicts in a new index extension section builtin-merge.c: use standard active_cache macros Conflicts: builtin-ls-files.c builtin-merge.c builtin-rerere.c
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
#include "tree-walk.h"
|
||||
#include "builtin.h"
|
||||
#include "refs.h"
|
||||
#include "resolve-undo.h"
|
||||
|
||||
/*
|
||||
* Default to not allowing changes to the list of files. The
|
||||
@ -440,7 +441,18 @@ static int unresolve_one(const char *path)
|
||||
|
||||
/* See if there is such entry in the index. */
|
||||
pos = cache_name_pos(path, namelen);
|
||||
if (pos < 0) {
|
||||
if (0 <= pos) {
|
||||
/* already merged */
|
||||
pos = unmerge_cache_entry_at(pos);
|
||||
if (pos < active_nr) {
|
||||
struct cache_entry *ce = active_cache[pos];
|
||||
if (ce_stage(ce) &&
|
||||
ce_namelen(ce) == namelen &&
|
||||
!memcmp(ce->name, path, namelen))
|
||||
return 0;
|
||||
}
|
||||
/* no resolve-undo information; fall back */
|
||||
} else {
|
||||
/* If there isn't, either it is unmerged, or
|
||||
* resolved as "removed" by mistake. We do not
|
||||
* want to do anything in the former case.
|
||||
@ -719,6 +731,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
|
||||
verbose = 1;
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(path, "--clear-resolve-undo")) {
|
||||
resolve_undo_clear();
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(path, "-h") || !strcmp(path, "--help"))
|
||||
usage(update_index_usage);
|
||||
die("unknown option %s", path);
|
||||
|
Reference in New Issue
Block a user