Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/dir.h
diff options
context:
space:
mode:
authorAtharva Raykar <raykar.ath@gmail.com>2021-08-10 14:46:36 +0300
committerJunio C Hamano <gitster@pobox.com>2021-08-10 21:45:11 +0300
commited86301f68fcbb17c5d1c7a3258e4705b3b1da9c (patch)
tree92399cb3da8013b689239f465e2fd8ea5f1ddbeb /dir.h
parent0c61041ed6778db86184d7a0d9759085f3cb9a82 (diff)
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.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/dir.h b/dir.h
index b3e1a54a97..63ff04f5ac 100644
--- a/dir.h
+++ b/dir.h
@@ -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);