summaryrefslogtreecommitdiff
path: root/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'nd/attr-match-optim-more'Jeff King2012-11-091-66/+126
|\ | | | | | | | | | | | | | | | | | | | | | | | | Start laying the foundation to build the "wildmatch" after we can agree on its desired semantics. * nd/attr-match-optim-more: attr: more matching optimizations from .gitignore gitignore: make pattern parsing code a separate function exclude: split pathname matching code into a separate function exclude: fix a bug in prefix compare optimization exclude: split basename matching code into a separate function exclude: stricten a length check in EXC_FLAG_ENDSWITH case
| * attr: more matching optimizations from .gitignoreNguyễn Thái Ngọc Duy2012-10-151-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | .gitattributes and .gitignore share the same pattern syntax but has separate matching implementation. Over the years, ignore's implementation accumulates more optimizations while attr's stays the same. This patch reuses the core matching functions that are also used by excluded_from_list. excluded_from_list and path_matches can't be merged due to differences in exclude and attr, for example: * "!pattern" syntax is forbidden in .gitattributes. As an attribute can be unset (i.e. set to a special value "false") or made back to unspecified (i.e. not even set to "false"), "!pattern attr" is unclear which one it means. * we support attaching attributes to directories, but git-core internally does not currently make use of attributes on directories. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * gitignore: make pattern parsing code a separate functionNguyễn Thái Ngọc Duy2012-10-151-22/+49
| | | | | | | | | | | | | | | | | | This function can later be reused by attr.c. Also turn to_exclude field into a flag. Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * exclude: split pathname matching code into a separate functionNguyễn Thái Ngọc Duy2012-10-151-32/+53
| | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * exclude: fix a bug in prefix compare optimizationNguyễn Thái Ngọc Duy2012-10-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When "namelen" becomes zero at this stage, we have matched the fixed part, but whether it actually matches the pattern still depends on the pattern in "exclude". As demonstrated in t3001, path "three/a.3" exists and it matches the "three/a.3" part in pattern "three/a.3[abc]", but that does not mean a true match. Don't be too optimistic and let fnmatch() do the job. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * exclude: split basename matching code into a separate functionNguyễn Thái Ngọc Duy2012-10-151-13/+24
| | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * exclude: stricten a length check in EXC_FLAG_ENDSWITH caseNguyễn Thái Ngọc Duy2012-10-151-2/+3
| | | | | | | | | | | | | | | | | | This block of code deals with the "basename" part only, which has the length of "pathlen - (basename - pathname)". Stricten the length check and remove "pathname" from the main expression to avoid confusion. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Merge commit 'f9f6e2c' into nd/attr-match-optim-moreJunio C Hamano2012-10-051-66/+77
| |\ | | | | | | | | | | | | | | | | | | * commit 'f9f6e2c': exclude: do strcmp as much as possible before fnmatch dir.c: get rid of the wildcard symbol set in no_wildcard() Unindent excluded_from_list()
| * \ Merge branch 'jc/ls-files-i-dir' into maintJunio C Hamano2012-07-111-1/+59
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git ls-files --exclude=t -i" did not consider anything under t/ as excluded, as it did not pay attention to exclusion of leading paths while walking the index. Other two users of excluded() are also updated. * jc/ls-files-i-dir: dir.c: make excluded() file scope static unpack-trees.c: use path_excluded() in check_ok_to_remove() builtin/add.c: use path_excluded() path_excluded(): update API to less cache-entry centric ls-files -i: micro-optimize path_excluded() ls-files -i: pay attention to exclusion of leading paths
* | | | warn_on_inaccessible(): a helper to warn on inaccessible pathsJunio C Hamano2012-08-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous series introduced warnings to multiple places, but it could become tiring to see the warning on the same path over and over again during a single run of Git. Making just one function responsible for issuing this warning, we could later choose to keep track of which paths we issued a warning (it would involve a hash table of paths after running them through real_path() or something) in order to reduce noise. Right now we do not know if the noise reduction is necessary, but it still would be a good code reduction/sharing anyway. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | gitignore: report access errors of exclude filesJeff King2012-08-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we try to access gitignore files, we check for their existence with a call to "access". We silently ignore missing files. However, if a file is not readable, this may be a configuration error; let's warn the user. For $GIT_DIR/info/excludes or core.excludesfile, we can just use access_or_warn. However, for per-directory files we actually try to open them, so we must add a custom warning. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'mm/config-xdg'Junio C Hamano2012-07-251-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finishing touches to the XDG support (new feature for 1.7.12) and tests. * mm/config-xdg: t1306: check that XDG_CONFIG_HOME works ignore: make sure we have an xdg path before using it attr: make sure we have an xdg path before using it test-lib.sh: unset XDG_CONFIG_HOME
| * | | | ignore: make sure we have an xdg path before using itMatthieu Moy2012-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit e3ebc35 (config: fix several access(NULL) calls, 2012-07-12) was fixing access(NULL) calls when trying to access $HOME/.config/git/config, but missed the ones when trying to access $HOME/.config/git/ignore. Fix and test this. Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'mm/config-xdg'Junio C Hamano2012-07-091-1/+6
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Teach git to read various information from $XDG_CONFIG_HOME/git/ to allow the user to avoid cluttering $HOME. * mm/config-xdg: config: write to $XDG_CONFIG_HOME/git/config file when appropriate Let core.attributesfile default to $XDG_CONFIG_HOME/git/attributes Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignore config: read (but not write) from $XDG_CONFIG_HOME/git/config file
| * | | | Let core.excludesfile default to $XDG_CONFIG_HOME/git/ignoreHuynh Khoi Nguyen Nguyen2012-06-251-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To use the feature of core.excludesfile, the user needs: 1. to create such a file, 2. and add configuration variable to point at it. Instead, we can make this a one-step process by choosing a default value which points to a filename in the user's $HOME, that is unlikely to already exist on the system, and only use the presence of the file as a cue that the user wants to use that feature. And we use "${XDG_CONFIG_HOME:-$HOME/.config/git}/ignore" as such a file, in the same directory as the newly added configuration file ("${XDG_CONFIG_HOME:-$HOME/.config/git}/config). The use of this directory is in line with XDG specification as a location to store such application specific files. Signed-off-by: Huynh Khoi Nguyen Nguyen <Huynh-Khoi-Nguyen.Nguyen@ensimag.imag.fr> Signed-off-by: Valentin Duperray <Valentin.Duperray@ensimag.imag.fr> Signed-off-by: Franck Jonas <Franck.Jonas@ensimag.imag.fr> Signed-off-by: Lucien Kong <Lucien.Kong@ensimag.imag.fr> Signed-off-by: Thomas Nguy <Thomas.Nguy@ensimag.imag.fr> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'nd/exclude-workaround-top-heavy'Junio C Hamano2012-06-281-66/+77
|\ \ \ \ \ | |/ / / / |/| | | / | | |_|/ | |/| | | | | | Attempt to optimize matching with an exclude pattern with a deep directory hierarchy by taking the part that specifies leading path without wildcard literally.
| * | | exclude: do strcmp as much as possible before fnmatchNguyễn Thái Ngọc Duy2012-06-071-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this also avoids calling fnmatch() if the non-wildcard prefix is longer than basename Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | dir.c: get rid of the wildcard symbol set in no_wildcard()Nguyễn Thái Ngọc Duy2012-06-071-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Elsewhere in this file is_glob_special() is also used to check for wildcards, which is defined in ctype. Make no_wildcard() also use this function (indirectly via simple_length()) Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Unindent excluded_from_list()Nguyễn Thái Ngọc Duy2012-05-291-48/+48
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | Return early if el->nr == 0. Unindent one more level for FNM_PATHNAME code block as this block is getting complex and may need more indentation. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'jc/ls-files-i-dir'Junio C Hamano2012-06-211-1/+59
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | | | | | | | | | | | "git ls-files --exclude=t -i" did not consider anything under t/ as excluded, as it did not pay attention to exclusion of leading paths while walking the index. Other two users of excluded() are also updated. * jc/ls-files-i-dir: dir.c: make excluded() file scope static unpack-trees.c: use path_excluded() in check_ok_to_remove() builtin/add.c: use path_excluded() path_excluded(): update API to less cache-entry centric ls-files -i: micro-optimize path_excluded() ls-files -i: pay attention to exclusion of leading paths
| * dir.c: make excluded() file scope staticJunio C Hamano2012-06-051-1/+1
| | | | | | | | | | | | | | Now there no longer is external callers of this interface, so we can make it static. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * path_excluded(): update API to less cache-entry centricJunio C Hamano2012-06-051-12/+20
| | | | | | | | | | | | | | | | It was stupid of me to make the API too much cache-entry specific; the caller may want to check arbitrary pathname without having a corresponding cache-entry to see if a path is ignored. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * ls-files -i: micro-optimize path_excluded()Junio C Hamano2012-06-031-0/+18
| | | | | | | | | | | | | | | | | | As we know a caller that does not recurse is calling us in the index order, we can remember the last directory we found to be excluded and see if the path we are looking at is still inside it, in which case we can just answer that it is excluded. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * ls-files -i: pay attention to exclusion of leading pathsJunio C Hamano2012-06-031-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "git ls-files --exclude=t/ -i" does not show paths in directory t/ that have been added to the index, but it should. The excluded() API was designed for callers who walk the tree from the top, checking each level of the directory hierarchy as it descends if it is excluded, and not even bothering to recurse into an excluded directory. This would allow us optimize for a common case by not having to check if the exclude pattern "foo/" matches when looking at "foo/bar", because the caller should have noticed that "foo" is excluded and did not even bother to read "foo/bar" out of opendir()/readdir() to call it. The code for "ls-files -i" however walks the index linearly, feeding paths without checking if the leading directory is already excluded. Introduce a helper function path_excluded() to let this caller properly call excluded() check for higher hierarchies as necessary. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | dir: simplify fill_directory()René Scharfe2012-05-111-8/+1
| | | | | | | | | | | | | | | | | | Now that read_directory_recursive() (reached through read_directory()) respects the string length limit we provide, we don't need to create a NUL-limited copy of the common prefix anymore. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | dir: respect string length argument of read_directory_recursive()René Scharfe2012-05-111-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | A directory name is passed to read_directory_recursive() as a length-limited string, through the parameters base and baselen. Suprisingly, base must be a NUL-terminated string as well, as it is passed to opendir(), ignoring baselen. Fix this by postponing the call to opendir() until the length-limted string is added to a strbuf, which provides a NUL in the right place. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'rs/maint-dir-strbuf' into rs/dir-strbufJunio C Hamano2012-05-081-39/+37
|\ \ | | | | | | | | | | | | | | | By René Scharfe * rs/maint-dir-strbuf: dir: convert to strbuf
| * | dir: convert to strbufRené Scharfe2012-05-081-39/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The functions read_directory_recursive() and treat_leading_path() both use buffers sized to fit PATH_MAX characters. The latter can be made to overrun its buffer, e.g. like this: $ a=0123456789abcdef $ a=$a$a$a$a$a$a$a$a $ a=$a$a$a$a$a$a$a$a $ a=$a$a$a$a$a$a$a$a $ git add $a/a Instead of trying to add a check and potentionally forgetting to address similar cases, convert the involved functions and their helpers to use struct strbuf. The patch is suprisingly large because the helpers treat_path() and treat_one_path() modify the buffer as well and thus need to be converted, too. Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | clean: preserve nested git worktree in subdirectoriesjc/maint-clean-nested-worktree-in-subdirJunio C Hamano2012-03-151-6/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove_dir_recursively() has a check to avoid removing the directory it was asked to remove without recursing into it and report success when the directory is the top level of a working tree of a nested git repository, to protect such a repository from "clean -f" (without double -f). If a working tree of a nested git repository is in a subdirectory of a toplevel project, however, this protection did not apply by mistake; we forgot to pass the REMOVE_DIR_KEEP_NESTED_GIT down to the recursive removal codepath. This requires us to also teach the higher level not to remove the directory it is asked to remove, when the recursed invocation did not remove the directory it was asked to remove due to a nested git repository, as it is not an error to leave the parent directories of such a nested repository. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | remove_dir_recursively(): Add flag for skipping removal of toplevel dirJunio C Hamano2012-03-151-4/+10
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Add the REMOVE_DIR_KEEP_TOPLEVEL flag to remove_dir_recursively() for deleting everything inside the given directory, but _not_ the given directory itself. Note that this does not pass the REMOVE_DIR_KEEP_NESTED_GIT flag, if set, to the recursive invocations of remove_dir_recursively(). It is likely to be a a bug that has been present since REMOVE_DIR_KEEP_NESTED_GIT was introduced (a0f4afb), but this commit keeps the same behaviour for now. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | read_directory_recursive: reduce one indentation levelNguyễn Thái Ngọc Duy2011-10-271-25/+25
| | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | rename pathspec_prefix() to common_prefix() and move to dir.[ch]Clemens Buchacher2011-09-121-1/+12
| | | | | | | | | | | | | | | | Also make common_prefix_len() static as this refactoring makes dir.c itself the only caller of this helper function. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | consolidate pathspec_prefix and common_prefixJunio C Hamano2011-09-061-29/+25
|/ | | | | | | | | The implementation from pathspec_prefix (slightly modified) replaces the current common_prefix, because it also respects glob characters. Based on a patch by Clemens Buchacher. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'nd/struct-pathspec'Junio C Hamano2011-05-061-3/+3
|\ | | | | | | | | | | | | | | * nd/struct-pathspec: pathspec: rename per-item field has_wildcard to use_wildcard Improve tree_entry_interesting() handling code Convert read_tree{,_recursive} to support struct pathspec Reimplement read_tree_recursive() using tree_entry_interesting()
| * pathspec: rename per-item field has_wildcard to use_wildcardJunio C Hamano2011-04-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | As the point of the last change is to allow use of strings as literals no matter what characters are in them, "has_wildcard" does not match what we use this field for anymore. It is used to decide if the wildcard matching should be used, so rename it to match the usage better. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'nd/maint-setup'Junio C Hamano2011-05-021-41/+29
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | * nd/maint-setup: Kill off get_relative_cwd() setup: return correct prefix if worktree is '/' Conflicts: dir.c setup.c
| * | Kill off get_relative_cwd()Nguyễn Thái Ngọc Duy2011-03-281-49/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Function dir_inside_of() does something similar (correctly), but looks easier to understand and does not bundle cwd to its business. Given get_relative_cwd's only user is is_inside_dir, we can kill it for good. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | setup: return correct prefix if worktree is '/'Nguyễn Thái Ngọc Duy2011-03-281-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same old problem reappears after setup code is reworked. We tend to assume there is at least one path component in a path and forget that path can be simply '/'. Reported-by: Matthijs Kooijman <matthijs@stdin.nl> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'ar/clean-rmdir-empty'Junio C Hamano2011-04-271-1/+1
|\ \ \ | | | | | | | | | | | | | | | | * ar/clean-rmdir-empty: clean: unreadable directory may still be rmdir-able if it is empty
| * | | clean: unreadable directory may still be rmdir-able if it is emptyAlex Riesen2011-04-011-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a last ditch effort, try rmdir(2) when we cannot read the directory to be removed. It may be an empty directory that we can remove without any permission, as long as we can modify its parent directory. Noticed by Linus. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Name make_*_path functions more accuratelyCarlos Martín Nieto2011-03-171-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | Rename the make_*_path functions so it's clearer what they do, in particlar make clear what the differnce between make_absolute_path and make_nonrelative_path is by renaming them real_path and absolute_path respectively. make_relative_path has an understandable name and is renamed to relative_path to maintain the name convention. The function calls have been replaced 1-to-1 in their usage. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | pathspec: add match_pathspec_depth()Nguyễn Thái Ngọc Duy2011-02-031-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | match_pathspec_depth() is a clone of match_pathspec() except that it can take depth limit. Computation is a bit lighter compared to match_pathspec() because it's usually precomputed and stored in struct pathspec. In long term, match_pathspec() and match_one() should be removed in favor of this function. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tree_entry_interesting(): support wildcard matchingNguyễn Thái Ngọc Duy2011-02-031-0/+3
| | | | | | | | | | | | | | | | never_interesting optimization is disabled if there is any wildcard pathspec, even if it only matches exactly on trees. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tree_entry_interesting(): fix depth limit with overlapping pathspecsNguyễn Thái Ngọc Duy2011-02-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Suppose we have two pathspecs 'a' and 'a/b' (both are dirs) and depth limit 1. In current code, pathspecs are checked in input order. When 'a/b' is checked against pathspec 'a', it fails depth limit and therefore is excluded, although it should match 'a/b' pathspec. This patch reorders all pathspecs alphabetically, then teaches tree_entry_interesting() to check against the deepest pathspec first, so depth limit of a shallower pathspec won't affect a deeper one. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | tree_entry_interesting(): support depth limitNguyễn Thái Ngọc Duy2011-02-031-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | This is needed to replace pathspec_matches() in builtin/grep.c. max_depth == -1 means infinite depth. Depth limit is only effective when pathspec.recursive == 1. When pathspec.recursive == 0, the behavior depends on match functions: non-recursive for tree_entry_interesting() and recursive for match_pathspec{,_depth} Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Add struct pathspecNguyễn Thái Ngọc Duy2011-02-031-0/+31
|/ | | | | | | | | | | | | The old pathspec structure remains as pathspec.raw[]. New things are stored in pathspec.items[]. There's no guarantee that the pathspec order in raw[] is exactly as in items[]. raw[] is external (source) data and is untouched by pathspec manipulation functions. It eases migration from old const char ** to this new struct. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'nd/maint-fix-add-typo-detection'Junio C Hamano2010-12-221-7/+12
|\ | | | | | | | | | | | | | | | | * nd/maint-fix-add-typo-detection: Revert "excluded_1(): support exclude files in index" unpack-trees: fix sparse checkout's "unable to match directories" unpack-trees: move all skip-worktree checks back to unpack_trees() dir.c: add free_excludes() cache.h: realign and use (1 << x) form for CE_* constants
| * Revert "excluded_1(): support exclude files in index"Nguyễn Thái Ngọc Duy2010-11-301-7/+0
| | | | | | | | | | | | | | | | | | This reverts commit c84de70781674a35b9bfd20aa5bc8c47582615df. The commit provided a workaround for matching directories in index. But it is no longer needed. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * dir.c: add free_excludes()Nguyễn Thái Ngọc Duy2010-11-291-0/+12
| | | | | | | | | | Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'nd/maint-relative'Junio C Hamano2010-12-161-0/+6
|\ \ | | | | | | | | | | | | * nd/maint-relative: get_cwd_relative(): do not misinterpret root path