Skip to content

Commit

Permalink
git-p4: format-patch to diff-tree change breaks binary patches
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tolga Ceylan authored and Junio C Hamano committed May 7, 2014
1 parent 109efbe commit 749b668
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-p4.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 -"
Expand Down

0 comments on commit 749b668

Please sign in to comment.