summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f192c5d)
raw | patch | inline | side by side (parent: f192c5d)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 13 Nov 2007 21:45:11 +0000 (13:45 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 13 Nov 2007 21:45:11 +0000 (13:45 -0800) |
I had to scratch my head for quite some time figuring out why we
cannot optimize out write_tree() we do when --no-commit option
is given, whose purpose seem to be only to check if the index is
unmerged, with a simple loop over the active_cache[].
So add a comment to describe why the write_tree() is there, and
resurrect the last scripted version as a reference material in
contrib/example directory with others.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cannot optimize out write_tree() we do when --no-commit option
is given, whose purpose seem to be only to check if the index is
unmerged, with a simple loop over the active_cache[].
So add a comment to describe why the write_tree() is there, and
resurrect the last scripted version as a reference material in
contrib/example directory with others.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-revert.c | patch | blob | history |
diff --git a/builtin-revert.c b/builtin-revert.c
index 62ab1fa1f484a113f45da96de8cd209a0c5c522e..afc28845f211a8a575baee00f73354ce91ea5a8d 100644 (file)
--- a/builtin-revert.c
+++ b/builtin-revert.c
if (no_commit) {
/*
* We do not intend to commit immediately. We just want to
- * merge the differences in.
+ * merge the differences in, so let's compute the tree
+ * that represents the "current" state for merge-recursive
+ * to work on.
*/
if (write_tree(head, 0, NULL))
die ("Your index file is unmerged.");