diff options
author | Russell Belfer <rb@github.com> | 2012-10-09 02:14:12 +0400 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-10-09 02:22:40 +0400 |
commit | dfbff793b8f39995d3a8744d6b7d75d5cc7201a0 (patch) | |
tree | 0ffa00f2e946fc65596b08b6064ac2fee25a0963 /src/iterator.c | |
parent | 543864b677704845660085d2b2b2249cabb084a4 (diff) |
Fix a few diff bugs with directory content
There are a few cases where diff should leave directories in
the diff list if we want to match core git, such as when the
directory contains a .git dir. That feature was lost when I
introduced some of the new submodule handling.
This restores that and then fixes a couple of related to diff
output that are triggered by having diffs with directories in
them.
Also, this adds a new flag that can be passed to diff if you
want diff output to actually include the file content of any
untracked files.
Diffstat (limited to 'src/iterator.c')
-rw-r--r-- | src/iterator.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/iterator.c b/src/iterator.c index e52554d4f..267687e01 100644 --- a/src/iterator.c +++ b/src/iterator.c @@ -905,3 +905,15 @@ int git_iterator_cmp( return ITERATOR_PREFIXCMP(*iter, entry->path, path_prefix); } +int git_iterator_current_workdir_path(git_iterator *iter, git_buf **path) +{ + workdir_iterator *wi = (workdir_iterator *)iter; + + if (iter->type != GIT_ITERATOR_WORKDIR || !wi->entry.path) + *path = NULL; + else + *path = &wi->path; + + return 0; +} + |