diff options
author | Atharva Raykar <raykar.ath@gmail.com> | 2021-08-10 13:46:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-10 20:45:11 +0200 |
commit | ed86301f68fcbb17c5d1c7a3258e4705b3b1da9c (patch) | |
tree | 92399cb3da8013b689239f465e2fd8ea5f1ddbeb /dir.h | |
parent | submodule--helper: remove repeated code in sync_submodule() (diff) | |
download | git-ed86301f68fcbb17c5d1c7a3258e4705b3b1da9c.tar.xz git-ed86301f68fcbb17c5d1c7a3258e4705b3b1da9c.zip |
dir: libify and export helper functions from clone.c
These functions can be useful to other parts of Git. Let's move them to
dir.c, while renaming them to be make their functionality more explicit.
Signed-off-by: Atharva Raykar <raykar.ath@gmail.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored-by: Shourya Shukla <periperidip@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'dir.h')
-rw-r--r-- | dir.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -453,6 +453,17 @@ static inline int is_dot_or_dotdot(const char *name) int is_empty_dir(const char *dir); +/* + * Retrieve the "humanish" basename of the given Git URL. + * + * For example: + * /path/to/repo.git => "repo" + * host.xz:foo/.git => "foo" + * http://example.com/user/bar.baz => "bar.baz" + */ +char *git_url_basename(const char *repo, int is_bundle, int is_bare); +void strip_dir_trailing_slashes(char *dir); + void setup_standard_excludes(struct dir_struct *dir); char *get_sparse_checkout_filename(void); |