Implement normalize_absolute_path
normalize_absolute_path removes several oddities form absolute paths, giving nice clean paths like "/dir/sub1/sub2". Also add a test case for this utility, based on a new test program (in the style of test-sha1). Signed-off-by: David Reiss <dreiss@facebook.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
377d9c409f
commit
ae299be0e5
1
cache.h
1
cache.h
@ -514,6 +514,7 @@ static inline int is_absolute_path(const char *path)
|
||||
return path[0] == '/';
|
||||
}
|
||||
const char *make_absolute_path(const char *path);
|
||||
int normalize_absolute_path(char *buf, const char *path);
|
||||
|
||||
/* Read and unpack a sha1 file into memory, write memory to a sha1 file */
|
||||
extern int sha1_object_info(const unsigned char *, unsigned long *);
|
||||
|
||||
Reference in New Issue
Block a user