aboutsummaryrefslogtreecommitdiffstats
path: root/dir.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-07-07 14:12:55 -0700
committerJunio C Hamano <gitster@pobox.com>2025-07-07 14:12:56 -0700
commit7310e539ada2b368e1c7243734ee7316639814f2 (patch)
treeae96aaaa39d398cd5a3f63c593cc9826be78d25c /dir.h
parent8b6f19ccfc3aefbd0f22f6b7d56ad6a3fc5e4f37 (diff)
parentca62f524c1eaef606b5c312de53ef7c4d9eefa4f (diff)
downloadgit-7310e539ada2b368e1c7243734ee7316639814f2.tar.gz
Merge branch 'jk/submodule-remote-lookup-cleanup'
Updating submodules from the upstream did not work well when submodule's HEAD is detached, which has been improved. * jk/submodule-remote-lookup-cleanup: submodule: look up remotes by URL first submodule: move get_default_remote_submodule() submodule--helper: improve logic for fallback remote name remote: remove the_repository from some functions dir: move starts_with_dot(_dot)_slash to dir.h remote: fix tear down of struct remote remote: remove branch->merge_name and fix branch_release()
Diffstat (limited to 'dir.h')
-rw-r--r--dir.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/dir.h b/dir.h
index d7e71aa8da..fc9be7b427 100644
--- a/dir.h
+++ b/dir.h
@@ -676,4 +676,27 @@ static inline int starts_with_dot_dot_slash_native(const char *const path)
return path_match_flags(path, what | PATH_MATCH_NATIVE);
}
+/**
+ * starts_with_dot_slash: convenience wrapper for
+ * patch_match_flags() with PATH_MATCH_STARTS_WITH_DOT_SLASH and
+ * PATH_MATCH_XPLATFORM.
+ */
+static inline int starts_with_dot_slash(const char *const path)
+{
+ const enum path_match_flags what = PATH_MATCH_STARTS_WITH_DOT_SLASH;
+
+ return path_match_flags(path, what | PATH_MATCH_XPLATFORM);
+}
+
+/**
+ * starts_with_dot_dot_slash: convenience wrapper for
+ * patch_match_flags() with PATH_MATCH_STARTS_WITH_DOT_DOT_SLASH and
+ * PATH_MATCH_XPLATFORM.
+ */
+static inline int starts_with_dot_dot_slash(const char *const path)
+{
+ const enum path_match_flags what = PATH_MATCH_STARTS_WITH_DOT_DOT_SLASH;
+
+ return path_match_flags(path, what | PATH_MATCH_XPLATFORM);
+}
#endif