bug: when applying binary diffs, -p0 is ignored

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I found a bug in git's handling of binary diff segments.

When applying binary diffs using -p0, the prefix (or --strip) argument
is ignored.

For example, try this:
git apply -p0 --binary <<'EOF'
diff --git a/init.tar.gz a/init.tar.gz
new file mode 100644
index 0000000000000000000000000000000000000000..
         386b94f511a17a8a3d62eb6cec14694cb9b9b51d
GIT binary patch
literal 118
zcmb2|=3qGT-8_JS`RzGFp(Y0bmIKvX{ySXzs`-OhSfm*K#a}SG%CY!eN_LjnjGuP-
zFH<V7m)|X1{OzyyaqIde8O2kg^q0P?b&0-p<;muDS-IC{I=+*S-L~Mn{_^zwEo=Tu
UurR>Dep|-nAGgFaXfQAU0L+LoA^-pY

literal 0
HcmV?d00001

EOF

It will create init.tar.gz, but in the root of the repository, not in a/

(Sorry if my mailer wraps the long index line)

cheers,
Colin McCabe
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]