diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-02 10:36:59 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-02 10:36:59 -0800 |
commit | f470e901f21d7a2b408c3e54e33e07bcc94913b1 (patch) | |
tree | 4b4c91cd6bbf23000e95af2b3d3ed2ab3832b6db /string-list.c | |
parent | 5d417842efeafb6e109db7574196901c4e95d273 (diff) | |
parent | 059b37934c611b1b9b735e0310ba282a0c7f5eba (diff) | |
download | git-f470e901f21d7a2b408c3e54e33e07bcc94913b1.tar.gz |
Merge branch 'mh/ceiling'
An element on GIT_CEILING_DIRECTORIES list that does not name the
real path to a directory (i.e. a symbolic link) could have caused
the GIT_DIR discovery logic to escape the ceiling.
* mh/ceiling:
string_list_longest_prefix(): remove function
setup_git_directory_gently_1(): resolve symlinks in ceiling paths
longest_ancestor_length(): require prefix list entries to be normalized
longest_ancestor_length(): take a string_list argument for prefixes
longest_ancestor_length(): use string_list_split()
Introduce new function real_path_if_valid()
real_path_internal(): add comment explaining use of cwd
Introduce new static function real_path_internal()
Diffstat (limited to 'string-list.c')
-rw-r--r-- | string-list.c | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/string-list.c b/string-list.c index 397e6cfa7d..480173fe6d 100644 --- a/string-list.c +++ b/string-list.c @@ -145,26 +145,6 @@ void string_list_remove_empty_items(struct string_list *list, int free_util) { filter_string_list(list, free_util, item_is_not_empty, NULL); } -char *string_list_longest_prefix(const struct string_list *prefixes, - const char *string) -{ - int i, max_len = -1; - char *retval = NULL; - - for (i = 0; i < prefixes->nr; i++) { - char *prefix = prefixes->items[i].string; - if (!prefixcmp(string, prefix)) { - int len = strlen(prefix); - if (len > max_len) { - retval = prefix; - max_len = len; - } - } - } - - return retval; -} - void string_list_clear(struct string_list *list, int free_util) { if (list->items) { |