summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-02 00:03:07 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-02 00:03:12 -0700
commit6e1ae015b4d6a55512be3f16f9a3eaaef343f09f (patch)
tree01b563f5f5481cc8aa5cda246dab78dcd113d03c /lib
parent9ec5bbf4d5622b67ce069c0006e5b3979e86c19e (diff)
downloadp5-Git-Annex-6e1ae015b4d6a55512be3f16f9a3eaaef343f09f.tar.gz
add abs_contentlocation
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'lib')
-rw-r--r--lib/Git/Annex.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Git/Annex.pm b/lib/Git/Annex.pm
index c872cf5..985f982 100644
--- a/lib/Git/Annex.pm
+++ b/lib/Git/Annex.pm
@@ -250,6 +250,19 @@ sub _clear_unused_cache {
unlink $self->_unused_cache;
}
+=head2 abs_contentlocation($key)
+
+Returns an absolute path to the content for git-annex key C<$key>.
+
+=cut
+
+sub abs_contentlocation {
+ my ($self, $key) = @_;
+ my $contentlocation;
+ try { ($contentlocation) = $self->git->annex("contentlocation", $key) };
+ $contentlocation ? rel2abs($contentlocation, $self->toplevel) : undef;
+}
+
sub _git_path {
my ($self, @input) = @_;
my ($path) = $self->git->rev_parse({ git_path => 1 }, catfile @input);