author | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Mar 2008 07:59:50 +0000 (23:59 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Mar 2008 07:59:50 +0000 (23:59 -0800) |
* 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
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
1 | 2 | |||
---|---|---|---|---|
builtin-revert.c | patch | | diff1 | | diff2 | | blob | history |
receive-pack.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin-revert.c
index b6dee6a56c21be816725a4366f448dac98e62ae6,64f0d0ee028fd143ea065cad93ce7be03d94839d..607a2f0337c3d3f1fb8bdac7443e3a7f56e92305
--- 1/builtin-revert.c
--- 2/builtin-revert.c
+++ b/builtin-revert.c
#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.
* 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();
}
diff --cc receive-pack.c
Simple merge