diff options
author | Brad King <brad.king@kitware.com> | 2014-01-27 09:45:06 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-24 14:30:22 -0800 |
commit | 29d9af586ba3ee1e6df1dc070f42ea659ad77cc2 (patch) | |
tree | 05d646a3d826e5c59df1e8086e4af396a2d935f3 /diff-lib.c | |
parent | Git 1.8.4.5 (diff) | |
download | tgif-29d9af586ba3ee1e6df1dc070f42ea659ad77cc2.tar.xz |
t3030-merge-recursive: test known breakage with empty work tree
Sometimes when working with a large repository it can be useful to try
out a merge and only check out conflicting files to disk (for example as
a speed optimization on a server). Until v1.7.7-rc1~28^2~20
(merge-recursive: When we detect we can skip an update, actually skip
it, 2011-08-11), it was possible to do so with the following idiom:
# Prepare a temporary index and empty work tree.
GIT_INDEX_FILE="$PWD/tmp-$$-index" &&
export GIT_INDEX_FILE &&
GIT_WORK_TREE="$PWD/tmp-$$-work" &&
export GIT_WORK_TREE &&
mkdir "$GIT_WORK_TREE" &&
# Convince the index that our side is on disk.
git read-tree -i -m $ours &&
git update-index --ignore-missing --refresh &&
# Merge their side into our side.
bases=$(git merge-base --all $ours $theirs) &&
git merge-recursive $bases -- $ours $theirs &&
tree=$(git write-tree)
Nowadays, that still works and the exit status is the same, but
merge-recursive produces a diagnostic if "our" side renamed a file:
error: addinfo_cache failed for path 'dst'
Add a test to document this regression.
Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff-lib.c')
0 files changed, 0 insertions, 0 deletions