diff options
author | Matthieu Moy <Matthieu.Moy@imag.fr> | 2009-12-07 11:10:50 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-12-07 13:35:06 -0800 |
commit | 009fee4774d4fa607cd97519d1044e426ed423b8 (patch) | |
tree | d29db0e8780e211abf2d46aa2441c04e22ce0460 /cache.h | |
parent | 9a424b276c409a3510e7735b6ecc012f50dc2a49 (diff) | |
download | git-009fee4774d4fa607cd97519d1044e426ed423b8.tar.gz |
Detailed diagnosis when parsing an object name fails.
The previous error message was the same in many situations (unknown
revision or path not in the working tree). We try to help the user as
much as possible to understand the error, especially with the
sha1:filename notation. In this case, we say whether the sha1 or the
filename is problematic, and diagnose the confusion between
relative-to-root and relative-to-$PWD confusion precisely.
The 7 new error messages are tested.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -702,7 +702,11 @@ static inline unsigned int hexval(unsigned char c) #define DEFAULT_ABBREV 7 extern int get_sha1(const char *str, unsigned char *sha1); -extern int get_sha1_with_mode(const char *str, unsigned char *sha1, unsigned *mode); +extern int get_sha1_with_mode_1(const char *str, unsigned char *sha1, unsigned *mode, int gently, const char *prefix); +static inline int get_sha1_with_mode(const char *str, unsigned char *sha1, unsigned *mode) +{ + return get_sha1_with_mode_1(str, sha1, mode, 1, NULL); +} extern int get_sha1_hex(const char *hex, unsigned char *sha1); extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */ extern int read_ref(const char *filename, unsigned char *sha1); |