summaryrefslogtreecommitdiffstats
path: root/git-am.sh
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-09-18 00:34:06 +0200
committerJunio C Hamano <gitster@pobox.com>2007-09-26 22:42:10 +0200
commit26b28007689d27a921ea90e5a29fc8eb74b0d297 (patch)
tree5d422206c3c7ca53af345f72e665bf5ae82be057 /git-am.sh
parentMove make_cache_entry() from merge-recursive.c into read-cache.c (diff)
downloadgit-26b28007689d27a921ea90e5a29fc8eb74b0d297.tar.xz
git-26b28007689d27a921ea90e5a29fc8eb74b0d297.zip
apply: get rid of --index-info in favor of --build-fake-ancestor
git-am used "git apply -z --index-info" to find the original versions of the files touched by the diff, to be able to do an inexpensive three-way merge. This operation makes only sense in a repository, since the index information in the diff refers to blobs, which have to be present in the current repository. Therefore, teach "git apply" a mode to write out the result as an index file to begin with, obviating the need for scripts to do it themselves. The sole user for --index-info is "git am" is converted to use --build-fake-ancestor in this patch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/git-am.sh b/git-am.sh
index b66173c0cd..32c46d7ed4 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -62,10 +62,8 @@ fall_back_3way () {
mkdir "$dotest/patch-merge-tmp-dir"
# First see if the patch records the index info that we can use.
- git apply -z --index-info "$dotest/patch" \
- >"$dotest/patch-merge-index-info" &&
- GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
- git update-index -z --index-info <"$dotest/patch-merge-index-info" &&
+ git apply --build-fake-ancestor "$dotest/patch-merge-tmp-index" \
+ "$dotest/patch" &&
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git write-tree >"$dotest/patch-merge-base+" ||
cannot_fallback "Repository lacks necessary blobs to fall back on 3-way merge."