aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-05-24 16:49:24 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-24 16:49:24 -0700
commita5c8a98ca7e978c334e956df7ae2165c75c494da (patch)
treedf77e4b7b652a72f6bb862e81a55f95692eda55a /git-am.sh
parent6858d494926437ad7b7e9199ea39953eb90c7bab (diff)
parent84c667ff97da2a3864ef7952b9f438d133ce35ef (diff)
downloadgit-a5c8a98ca7e978c334e956df7ae2165c75c494da.tar.gz
git-a5c8a98ca7e978c334e956df7ae2165c75c494da.tar.xz
Merge branch 'master' into sp/reflog
* master: (90 commits) fetch.c: remove an unused variable and dead code. Clean up sha1 file writing Builtin git-cat-file builtin format-patch: squelch content-type for 7-bit ASCII CMIT_FMT_EMAIL: Q-encode Subject: and display-name part of From: fields. add more informative error messages to git-mktag remove the artificial restriction tagsize < 8kb git-rebase: use canonical A..B syntax to format-patch git-format-patch: now built-in. fmt-patch: Support --attach fmt-patch: understand old <his> notation Teach fmt-patch about --keep-subject Teach fmt-patch about --numbered fmt-patch: implement -o <dir> fmt-patch: output file names to stdout Teach fmt-patch to write individual files. built-in tar-tree and remote tar-tree Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree. Builtin git-show-branch. Builtin git-apply. ...
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh38
1 files changed, 2 insertions, 36 deletions
diff --git a/git-am.sh b/git-am.sh
index 25c95c24f..4232e2741 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -59,46 +59,12 @@ fall_back_3way () {
GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
git-write-tree >"$dotest/patch-merge-base+" &&
# index has the base tree now.
- (
- cd "$dotest/patch-merge-tmp-dir" &&
- GIT_INDEX_FILE="../patch-merge-tmp-index" \
- GIT_OBJECT_DIRECTORY="$O_OBJECT" \
- git-apply $binary --index <../patch
- )
+ GIT_INDEX_FILE="$dotest/patch-merge-tmp-index" \
+ git-apply $binary --cached <"$dotest/patch"
then
echo Using index info to reconstruct a base tree...
mv "$dotest/patch-merge-base+" "$dotest/patch-merge-base"
mv "$dotest/patch-merge-tmp-index" "$dotest/patch-merge-index"
- else
- # Otherwise, try nearby trees that can be used to apply the
- # patch.
- (
- N=10
-
- # Hoping the patch is against our recent commits...
- git-rev-list --max-count=$N HEAD
-
- # or hoping the patch is against known tags...
- git-ls-remote --tags .
- ) |
- while read base junk
- do
- # See if we have it as a tree...
- git-cat-file tree "$base" >/dev/null 2>&1 || continue
-
- rm -fr "$dotest"/patch-merge-* &&
- mkdir "$dotest/patch-merge-tmp-dir" || break
- (
- cd "$dotest/patch-merge-tmp-dir" &&
- GIT_INDEX_FILE=../patch-merge-tmp-index &&
- GIT_OBJECT_DIRECTORY="$O_OBJECT" &&
- export GIT_INDEX_FILE GIT_OBJECT_DIRECTORY &&
- git-read-tree "$base" &&
- git-apply $binary --index &&
- mv ../patch-merge-tmp-index ../patch-merge-index &&
- echo "$base" >../patch-merge-base
- ) <"$dotest/patch" 2>/dev/null && break
- done
fi
test -f "$dotest/patch-merge-index" &&