From: Junio C Hamano Date: Mon, 3 Mar 2008 07:59:50 +0000 (-0800) Subject: Merge branch 'maint' X-Git-Tag: v1.5.5-rc0~79 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6b48990354b6380665565f21c3f89d2f7109c459;p=git.git Merge branch 'maint' * maint: Update draft release notes for 1.5.4.4 revert: actually check for a dirty index tests: introduce test_must_fail git-submodule: Fix typo 'url' which should be '$url' receive-pack: Initialize PATH to include exec-dir. Conflicts: builtin-revert.c --- 6b48990354b6380665565f21c3f89d2f7109c459 diff --cc builtin-revert.c index b6dee6a56,64f0d0ee0..607a2f033 --- a/builtin-revert.c +++ b/builtin-revert.c @@@ -8,7 -8,8 +8,9 @@@ #include "exec_cmd.h" #include "utf8.h" #include "parse-options.h" +#include "cache-tree.h" + #include "diff.h" + #include "revision.h" /* * This implements the builtins revert and cherry-pick. @@@ -271,15 -283,14 +284,14 @@@ static int revert_or_cherry_pick(int ar * that represents the "current" state for merge-recursive * to work on. */ - if (write_tree(head, 0, NULL)) + if (write_cache_as_tree(head, 0, NULL)) die ("Your index file is unmerged."); } else { - struct wt_status s; - if (get_sha1("HEAD", head)) die ("You do not have a valid HEAD"); - wt_status_prepare(&s); - if (s.commitable) + if (read_cache() < 0) + die("could not read the index"); + if (index_is_dirty()) die ("Dirty index: cannot %s", me); discard_cache(); }