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 '<filename>' without full index line error: <filename>: patch does not apply Signed-off-by: Tolga Ceylan <tolga.ceylan@gmail.com> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Tolga Ceylan committed
May 6, 2014 at 22:48 UTC
749b668c7db563609de3de7595504f2dca8eef7d
1 file changed
+1
-1
git-p4.py
+1
-1
@@ -1308,7 +1308,7 @@ class P4Submit(Command, P4UserMap):
1308
else:
1309
die("unknown modifier %s for %s" % (modifier, path))
1310
1311
- diffcmd = "git diff-tree -p \"%s\"" % (id)
1311
+ diffcmd = "git diff-tree --full-index -p \"%s\"" % (id)
1312
patchcmd = diffcmd + " | git apply "
1313
tryPatchCmd = patchcmd + "--check -"
1314
applyPatchCmd = patchcmd + "--check --apply -"