diff options
author | Russell Belfer <rb@github.com> | 2012-11-08 16:56:34 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-11-09 13:52:07 -0800 |
commit | 55cbd05b18960e761a4d237ce5f1ff06455da98d (patch) | |
tree | ef602ca15261aa1d5ff6be6ea043d74d5fc45459 /src/iterator.c | |
parent | 2e3d4b96c08f1b0e2ee9b248c53aec523d70fd25 (diff) | |
download | libgit2-55cbd05b18960e761a4d237ce5f1ff06455da98d.tar.gz |
Some diff refactorings to help code reuse
There are some diff functions that are useful in a rewritten
checkout and this lays some groundwork for that. This contains
three main things:
1. Share the function diff uses to calculate the OID for a file
in the working directory (now named `git_diff__oid_for_file`
2. Add a `git_diff__paired_foreach` function to iterator over
two diff lists concurrently. Convert status to use it.
3. Move all the string/prefix/index entry comparisons into
function pointers inside the `git_diff_list` object so they
can be switched between case sensitive and insensitive
versions. This makes them easier to reuse in various
functions without replicating logic. As part of this, move
a couple of index functions out of diff.c and into index.c.
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/iterator.c b/src/iterator.c index 20878a060..33b775ce1 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -648,7 +648,7 @@ static int workdir_iterator__update_entry(workdir_iterator *wi) wi->is_ignored = -1; - git_index__init_entry_from_stat(&ps->st, &wi->entry); + git_index_entry__init_from_stat(&wi->entry, &ps->st); /* need different mode here to keep directories during iteration */ wi->entry.mode = git_futils_canonical_mode(ps->st.st_mode); |