diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-08-03 11:01:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-08-03 11:01:13 -0700 |
commit | 54d673f25d571ac2d8f50b1ccea4a7d69ca8a056 (patch) | |
tree | 2357d79569f29fa36a998dcf723756e015a12f8d /cache.h | |
parent | e12b51e4d685c30f488c99c5d89f3310c3fcd9b0 (diff) | |
parent | 38ae8784074852c8e7b651f4f6e44e07466da7e1 (diff) | |
download | git-54d673f25d571ac2d8f50b1ccea4a7d69ca8a056.tar.gz |
Merge branch 'ee/clean-remove-dirs'
Replace "is this subdirectory a separate repository that should not
be touched?" check "git clean" does by checking if it has .git/HEAD
using the submodule-related code with a more optimized check.
* ee/clean-remove-dirs:
read_gitfile_gently: fix use-after-free
clean: improve performance when removing lots of directories
p7300: add performance tests for clean
t7300: add tests to document behavior of clean and nested git
setup: sanity check file size in read_gitfile_gently
setup: add gentle version of read_gitfile
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -447,7 +447,17 @@ extern int get_common_dir(struct strbuf *sb, const char *gitdir); extern const char *get_git_namespace(void); extern const char *strip_namespace(const char *namespaced_ref); extern const char *get_git_work_tree(void); -extern const char *read_gitfile(const char *path); + +#define READ_GITFILE_ERR_STAT_FAILED 1 +#define READ_GITFILE_ERR_NOT_A_FILE 2 +#define READ_GITFILE_ERR_OPEN_FAILED 3 +#define READ_GITFILE_ERR_READ_FAILED 4 +#define READ_GITFILE_ERR_INVALID_FORMAT 5 +#define READ_GITFILE_ERR_NO_PATH 6 +#define READ_GITFILE_ERR_NOT_A_REPO 7 +#define READ_GITFILE_ERR_TOO_LARGE 8 +extern const char *read_gitfile_gently(const char *path, int *return_error_code); +#define read_gitfile(path) read_gitfile_gently((path), NULL) extern const char *resolve_gitdir(const char *suspect); extern void set_git_work_tree(const char *tree); |