summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d9a2f4)
raw | patch | inline | side by side (parent: 9d9a2f4)
author | Junio C Hamano <gitster@pobox.com> | |
Fri, 25 Dec 2009 18:31:26 +0000 (10:31 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 26 Dec 2009 01:10:10 +0000 (17:10 -0800) |
At the Porcelain level, operations such as merge that populate an
initially cleanly merged index with conflicted entries clear the
resolve-undo information upfront. Give scripted Porcelains a way
to do the same, by implementing "update-index --clear-resolve-info".
With this, a scripted Porcelain may "update-index --clear-resolve-info"
first and repeatedly run "update-index --cacheinfo" to stuff unmerged
entries to the index, to be resolved by the user with "git add" and
stuff.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
initially cleanly merged index with conflicted entries clear the
resolve-undo information upfront. Give scripted Porcelains a way
to do the same, by implementing "update-index --clear-resolve-info".
With this, a scripted Porcelain may "update-index --clear-resolve-info"
first and repeatedly run "update-index --cacheinfo" to stuff unmerged
entries to the index, to be resolved by the user with "git add" and
stuff.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-update-index.c | patch | blob | history | |
t/t2030-unresolve-info.sh | patch | blob | history |
diff --git a/builtin-update-index.c b/builtin-update-index.c
index a6b7f2d6361fc1e8ea9713082affc72362f08d76..a19e78603cb4f0b6464bd974fc7bc12b3ad6c0d7 100644 (file)
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
#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
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);
index 785c8b3fca1707ca0e2290acbf3c6585ea7cb0fd..984480271c0deef50dddae215a59aa62471c0e47 100755 (executable)
check_resolve_undo discarded
'
+test_expect_success 'plumbing clears' '
+ prime_resolve_undo &&
+ test_tick &&
+ git commit -m merged &&
+ echo committing keeps &&
+ check_resolve_undo kept file initial:file second:file third:file &&
+
+ echo plumbing clear &&
+ git update-index --clear-resolve-undo &&
+ check_resolve_undo cleared
+'
+
test_done