From: Tolga Ceylan Date: Wed, 7 May 2014 05:48:54 +0000 (-0700) Subject: git-p4: format-patch to diff-tree change breaks binary patches X-Git-Tag: v1.9.3~3^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/749b668c7db563609de3de7595504f2dca8eef7d?ds=inline;hp=--cc git-p4: format-patch to diff-tree change breaks binary patches When applying binary patches a full index is required. format-patch already handles this, but diff-tree needs '--full-index' argument to always output full index. When git-p4 runs git-apply to test the patch, git-apply rejects the patch due to abbreviated blob object names. This is the error message git-apply emits in this case: error: cannot apply binary patch to '' without full index line error: : patch does not apply Signed-off-by: Tolga Ceylan Acked-by: Pete Wyckoff Signed-off-by: Junio C Hamano --- 749b668c7db563609de3de7595504f2dca8eef7d diff --git a/git-p4.py b/git-p4.py index fe988cec49..17760c73e5 100755 --- a/git-p4.py +++ b/git-p4.py @@ -1308,7 +1308,7 @@ def applyCommit(self, id): else: die("unknown modifier %s for %s" % (modifier, path)) - diffcmd = "git diff-tree -p \"%s\"" % (id) + diffcmd = "git diff-tree --full-index -p \"%s\"" % (id) patchcmd = diffcmd + " | git apply " tryPatchCmd = patchcmd + "--check -" applyPatchCmd = patchcmd + "--check --apply -"