diff options
| author | Russell Belfer <rb@github.com> | 2012-11-28 09:58:48 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2012-11-28 09:58:48 -0800 |
| commit | 7bf87ab6987cf6b9e166e23d2d9dbdcd2511fb32 (patch) | |
| tree | dcc8a92ce69b2a0d9d8cca98d67f0cc71177ce40 /src/submodule.c | |
| parent | 693021262ba0eeac2923bbce1b2262717019c807 (diff) | |
| download | libgit2-7bf87ab6987cf6b9e166e23d2d9dbdcd2511fb32.tar.gz | |
Consolidate text buffer functions
There are many scattered functions that look into the contents of
buffers to do various text manipulations (such as escaping or
unescaping data, calculating text stats, guessing if content is
binary, etc). This groups all those functions together into a
new file and converts the code to use that.
This has two enhancements to existing functionality. The old
text stats function is significantly rewritten and the BOM
detection code was extended (although largely we can't deal with
anything other than a UTF8 BOM).
Diffstat (limited to 'src/submodule.c')
| -rw-r--r-- | src/submodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/submodule.c b/src/submodule.c index 15158f0d8..c117255d4 100644 --- a/src/submodule.c +++ b/src/submodule.c @@ -12,6 +12,7 @@ #include "git2/index.h" #include "git2/submodule.h" #include "buffer.h" +#include "buf_text.h" #include "vector.h" #include "posix.h" #include "config_file.h" @@ -782,7 +783,7 @@ int git_submodule_reload(git_submodule *submodule) git_buf path = GIT_BUF_INIT; git_buf_sets(&path, "submodule\\."); - git_buf_puts_escape_regex(&path, submodule->name); + git_buf_text_puts_escape_regex(&path, submodule->name); git_buf_puts(&path, ".*"); if (git_buf_oom(&path)) |
