summaryrefslogtreecommitdiff
path: root/lib/Git/Annex.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Git/Annex.pm')
-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);