aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@osdl.org>2006-05-18 12:07:31 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-18 12:07:31 -0700
commit8dcf39c46e2931ca02b18b1ea3a6b21f446d8de8 (patch)
treefaa37fc9e41acdfb704ece258315fd37ddc6bcb4 /cache.h
parente8f990b4e4b56f214138cc475c19e5a253e9148e (diff)
downloadgit-8dcf39c46e2931ca02b18b1ea3a6b21f446d8de8.tar.gz
git-8dcf39c46e2931ca02b18b1ea3a6b21f446d8de8.tar.xz
Prevent bogus paths from being added to the index.
With this one, it's now a fatal error to try to add a pathname that cannot be added with "git add", i.e. [torvalds@g5 git]$ git add .git/config fatal: unable to add .git/config to index and [torvalds@g5 git]$ git add foo/../bar fatal: unable to add foo/../bar to index instead of the old "Ignoring path xyz" warning that would end up silently succeeding on any other paths. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 4b7a43925..89aa4f6c7 100644
--- a/cache.h
+++ b/cache.h
@@ -142,6 +142,7 @@ extern void verify_non_filename(const char *prefix, const char *name);
/* Initialize and use the cache information */
extern int read_cache(void);
extern int write_cache(int newfd, struct cache_entry **cache, int entries);
+extern int verify_path(const char *path);
extern int cache_name_pos(const char *name, int namelen);
#define ADD_CACHE_OK_TO_ADD 1 /* Ok to add */
#define ADD_CACHE_OK_TO_REPLACE 2 /* Ok to replace file/directory */