Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fix

* ko/master: (2325 commits)
  Git 1.7.2-rc2
  backmerge a few more fixes to 1.7.1.X series
  fix git branch -m in presence of cross devices
  t/t0006: specify timezone as EST5 not EST to comply with POSIX
  add missing && to submodule-merge testcase
  t/README: document more test helpers
  test-date: fix sscanf type conversion
  xdiff: optimise for no whitespace difference when ignoring whitespace.
  gitweb: Move evaluate_gitweb_config out of run_request
  parse_date: fix signedness in timezone calculation
  t0006: test timezone parsing
  rerere.txt: Document forget subcommand
  t/README: proposed rewording...
  t/README: Document the do's and don'ts of tests
  t/README: Add a section about skipping tests
  t/README: Document test_expect_code
  t/README: Document test_external*
  t/README: Document the prereq functions, and 3-arg test_*
  t/README: Typo: paralell -> parallel
  t/README: The trash is in 't/trash directory.$name'
  ...

Conflicts:
	builtin-read-tree.c
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 8bdcab1..9ad1e66 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -219,14 +219,9 @@
 	 * "-m ent" or "--reset ent" form), we can obtain a fully
 	 * valid cache-tree because the index must match exactly
 	 * what came from the tree.
-	 *
-	 * The same holds true if we are switching between two trees
-	 * using read-tree -m A B.  The index must match B after that.
 	 */
 	if (nr_trees == 1 && !opts.prefix)
 		prime_cache_tree(&active_cache_tree, trees[0]);
-	else if (nr_trees == 2 && opts.merge)
-		prime_cache_tree(&active_cache_tree, trees[1]);
 
 	if (write_cache(newfd, active_cache, active_nr) ||
 	    commit_locked_index(&lock_file))
diff --git a/t/t1001-read-tree-m-2way.sh b/t/t1001-read-tree-m-2way.sh
index 6327d20..0c562bb 100755
--- a/t/t1001-read-tree-m-2way.sh
+++ b/t/t1001-read-tree-m-2way.sh
@@ -390,4 +390,20 @@
      git ls-files --stage | tee >treeMcheck.out &&
      test_cmp treeM.out treeMcheck.out'
 
+test_expect_success '-m references the correct modified tree' '
+	echo >file-a &&
+	echo >file-b &&
+	git add file-a file-b &&
+	git commit -a -m "test for correct modified tree"
+	git branch initial-mod &&
+	echo b >file-b &&
+	git commit -a -m "B" &&
+	echo a >file-a &&
+	git add file-a &&
+	git ls-tree $(git write-tree) file-a >expect &&
+	git read-tree -m HEAD initial-mod &&
+	git ls-tree $(git write-tree) file-a >actual &&
+	test_cmp expect actual
+'
+
 test_done