diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-03-07 12:47:15 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-07 12:47:15 -0800 |
commit | c2b456b8956c2091318edaee362119e0e96b86b7 (patch) | |
tree | dc2fa7fbcc84a8638248cfaaa4b10538efcf5857 /path.c | |
parent | 000d2c07ef65b19bd9cf30ef44a3018b8f110b2c (diff) | |
parent | 3719b2fe554adc2f7a34a16b90f6894f299aab3c (diff) | |
download | git-c2b456b8956c2091318edaee362119e0e96b86b7.tar.gz |
Merge branch 'nd/root-git'
* nd/root-git:
Add test for using Git at root of file system
Support working directory located at root
Move offset_1st_component() to path.c
init-db, rev-parse --git-dir: do not append redundant slash
make_absolute_path(): Do not append redundant slash
Conflicts:
setup.c
sha1_file.c
Diffstat (limited to 'path.c')
-rw-r--r-- | path.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -728,3 +728,10 @@ int daemon_avoid_alias(const char *p) } } } + +int offset_1st_component(const char *path) +{ + if (has_dos_drive_prefix(path)) + return 2 + is_dir_sep(path[2]); + return is_dir_sep(path[0]); +} |