summaryrefslogtreecommitdiff
path: root/abspath.c
diff options
context:
space:
mode:
Diffstat (limited to 'abspath.c')
-rw-r--r--abspath.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/abspath.c b/abspath.c
index 2825de8591..af82abd033 100644
--- a/abspath.c
+++ b/abspath.c
@@ -152,6 +152,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