summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Command/AddUrl.hs1
-rw-r--r--debian/changelog2
-rw-r--r--doc/bugs/addurl:___34__rename:_does_not_exist__34___and_reports_fail__44___but_succeeds.mdwn6
3 files changed, 9 insertions, 0 deletions
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index c4062068a..f45d00cc6 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -151,6 +151,7 @@ url2file :: URI -> Maybe Int -> FilePath
url2file url pathdepth = case pathdepth of
Nothing -> filesize $ escape fullurl
Just depth
+ | depth >= length urlbits -> frombits id
| depth > 0 -> frombits $ drop depth
| depth < 0 -> frombits $ reverse . take (negate depth) . reverse
| otherwise -> error "bad --pathdepth"
diff --git a/debian/changelog b/debian/changelog
index d9eac61a4..1f8a46154 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -15,6 +15,8 @@ git-annex (4.20130628) UNRELEASED; urgency=low
* init: Detect systems on which git commit fails due to not being able to
determine the FQDN, and put in a workaround so committing to the git-annex
branch works.
+ * addurl --pathdepth: Fix failure when the pathdepth specified is deeper
+ than the urls's path.
-- Joey Hess <joeyh@debian.org> Tue, 02 Jul 2013 15:40:55 -0400
diff --git a/doc/bugs/addurl:___34__rename:_does_not_exist__34___and_reports_fail__44___but_succeeds.mdwn b/doc/bugs/addurl:___34__rename:_does_not_exist__34___and_reports_fail__44___but_succeeds.mdwn
index 60a150e7f..3383dd52a 100644
--- a/doc/bugs/addurl:___34__rename:_does_not_exist__34___and_reports_fail__44___but_succeeds.mdwn
+++ b/doc/bugs/addurl:___34__rename:_does_not_exist__34___and_reports_fail__44___but_succeeds.mdwn
@@ -189,3 +189,9 @@ All interesting transcripts are posted above with cruft removed.
# End of transcript or log.
"""]]
+
+> The cause of this bug is using --pathdepth=3 when the url
+> only has two components in its path. So, kinda GIGO, but
+> let's fix this anyway. ;)
+>
+> [[fixed|done]] --[[Joey]]