path: root/cache.h
diff options
authorMatthieu Moy <>2012-06-18 18:18:21 (GMT)
committerJunio C Hamano <>2012-06-18 22:21:42 (GMT)
commit023e37c37780d6a56f2870a979c8eb3a9ee9a44d (patch)
tree74075e3fc2bf0cf4ca3997d1a745948a82c13e89 /cache.h
parentd7236c4395a0c8742871a72d920f789b5bd4abf6 (diff)
verify_filename(): ask the caller to chose the kind of diagnosis
verify_filename() can be called in two different contexts. Either we just tried to interpret a string as an object name, and it fails, so we try looking for a working tree file (i.e. we finished looking at revs that come earlier on the command line, and the next argument must be a pathname), or we _know_ that we are looking for a pathname, and shouldn't even try interpreting the string as an object name. For example, with this change, we get: $ git log COPYING HEAD:inexistant fatal: HEAD:inexistant: no such path in the working tree. Use '-- <path>...' to specify paths that do not exist locally. $ git log HEAD:inexistant fatal: Path 'inexistant' does not exist in 'HEAD' Signed-off-by: Matthieu Moy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'cache.h')
1 files changed, 3 insertions, 1 deletions
diff --git a/cache.h b/cache.h
index 10afd71..35383e3 100644
--- a/cache.h
+++ b/cache.h
@@ -452,7 +452,9 @@ extern const char *setup_git_directory(void);
extern char *prefix_path(const char *prefix, int len, const char *path);
extern const char *prefix_filename(const char *prefix, int len, const char *path);
extern int check_filename(const char *prefix, const char *name);
-extern void verify_filename(const char *prefix, const char *name);
+extern void verify_filename(const char *prefix,
+ const char *name,
+ int diagnose_misspelt_rev);
extern void verify_non_filename(const char *prefix, const char *name);
#define INIT_DB_QUIET 0x0001