summaryrefslogtreecommitdiff
path: root/include/git2/diff.h
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-04-26 15:35:47 -0700
committerRussell Belfer <rb@github.com>2013-04-30 04:25:56 -0700
commite26b14c0345ef82771f222aa50be926f5969531d (patch)
tree2471b9eaba32bd46589d778e6d6a5dfbeb9b7d03 /include/git2/diff.h
parentfdb3034e725ccf2c7be11871fcc374ced436983e (diff)
downloadlibgit2-e26b14c0345ef82771f222aa50be926f5969531d.tar.gz
Update diff handling of untracked directories
When diff encounters an untracked directory, there was a shortcut that it took which is not compatible with core git. This makes the default behavior no longer take that shortcut and instead look inside the untracked directory to see if there are any untracked files within it. If there are not, then the directory is treated as an ignore directory instead of an untracked directory. This has implications for the git_status APIs.
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r--include/git2/diff.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h
index d9ceadf20..cc16d01b6 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -124,6 +124,13 @@ typedef enum {
* adds all files under the directory as IGNORED entries, too.
*/
GIT_DIFF_RECURSE_IGNORED_DIRS = (1 << 18),
+ /** For an untracked directory, diff can immediately label it UNTRACKED,
+ * but this differs from core Git which scans underneath for untracked
+ * or ignored files and marks the directory ignored unless it contains
+ * untracked files under it. That search can be slow. This flag makes
+ * diff skip ahead and immediately report the directory as untracked.
+ */
+ GIT_DIFF_FAST_UNTRACKED_DIRS = (1 << 19),
} git_diff_option_t;
/**