Skip to content

Commit

Permalink
builtin-apply.c: make it more line oriented
Browse files Browse the repository at this point in the history
This changes the way git-apply internally works to be more line
oriented.  The logic to find where the patch applies with offset
used to count line numbers by always counting LF from the
beginning of the buffer, but it is simplified because we count
the line length of the target file and the preimage snippet
upfront now.

The ultimate motivation is to allow applying patches
whose preimage context has whitespace corruption that has
already been corrected in the local copy.  For that purpose, we
introduce a table of line-hash that allows us to match lines
that differ only in whitespaces.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Feb 5, 2008
1 parent dc41976 commit b94f2ed
Showing 1 changed file with 280 additions and 123 deletions.
Loading

0 comments on commit b94f2ed

Please sign in to comment.