summaryrefslogtreecommitdiff
path: root/abspath.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-02-02 21:36:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-02-02 21:36:55 (GMT)
commit6f1c08bdb75b37ad30103f0f12339780fdc004e2 (patch)
tree3a6909ffaaa512519c3f6f6e7a11f0956276bcd1 /abspath.c
parentd008809bb5d1f9a669ee89b77b3a4b6bb7905009 (diff)
parent0aaad415bcbdd7ccdfbb27eafb2f5926540455fa (diff)
downloadgit-6f1c08bdb75b37ad30103f0f12339780fdc004e2.zip
git-6f1c08bdb75b37ad30103f0f12339780fdc004e2.tar.gz
git-6f1c08bdb75b37ad30103f0f12339780fdc004e2.tar.bz2
Merge branch 'rs/absolute-pathdup'
Code cleanup. * rs/absolute-pathdup: use absolute_pathdup() abspath: add absolute_pathdup()
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 fce40fd..2f0c26e 100644
--- 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