From 749b668c7db563609de3de7595504f2dca8eef7d Mon Sep 17 00:00:00 2001 From: Tolga Ceylan Date: Tue, 6 May 2014 22:48:54 -0700 Subject: [PATCH] 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 --- git-p4.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ class P4Submit(Command, P4UserMap): 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 -" -- 2.11.4.GIT