aboutsummaryrefslogtreecommitdiffstats
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-04-22 13:42:44 -0700
committerJunio C Hamano <gitster@pobox.com>2020-04-22 13:42:44 -0700
commitd01b722b7a077202c82902f49c48cb8081c696ef (patch)
tree0a72203d0a9f8abd6f6efbaa9e87cd68b946604f /git-compat-util.h
parentMerge branch 'dr/midx-avoid-int-underflow' (diff)
parentrun-command: trigger PATH lookup properly on Cygwin (diff)
downloadgit-d01b722b7a077202c82902f49c48cb8081c696ef.tar.gz
git-d01b722b7a077202c82902f49c48cb8081c696ef.zip
Merge branch 'ak/run-command-on-cygwin-fix'
Utitiles run via the run_command() API were not spawned correctly on Cygwin, when the paths to them are given as a full path with backslashes. * ak/run-command-on-cygwin-fix: run-command: trigger PATH lookup properly on Cygwin
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index aed0b5d4f9..8ba576e81e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -389,6 +389,14 @@ static inline char *git_find_last_dir_sep(const char *path)
#define find_last_dir_sep git_find_last_dir_sep
#endif
+#ifndef has_dir_sep
+static inline int git_has_dir_sep(const char *path)
+{
+ return !!strchr(path, '/');
+}
+#define has_dir_sep(path) git_has_dir_sep(path)
+#endif
+
#ifndef query_user_email
#define query_user_email() NULL
#endif