setup: introduce the discover_git_directory() function
[gitweb.git] / abspath.c
index fce40fddcc3b68a644fb93a698da8164a1d9b9cf..2f0c26e0e2cbee88aa671f3960d21720e4307aba 100644 (file)
--- a/abspath.c
+++ b/abspath.c
@@ -239,6 +239,13 @@ const char *absolute_path(const char *path)
        return sb.buf;
 }
 
+char *absolute_pathdup(const char *path)
+{
+       struct strbuf sb = STRBUF_INIT;
+       strbuf_add_absolute_path(&sb, path);
+       return strbuf_detach(&sb, NULL);
+}
+
 /*
  * Unlike prefix_path, this should be used if the named file does
  * not have to interact with index entry; i.e. name of a random file