summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-11-21 11:30:53 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-11-21 11:30:53 -0400
commitfed5a751e0ebc95f2acd66f372883bd096d0dd07 (patch)
treeed3660ef48d04637c9015a552155863b5cb575df
parentad26b39c9873db721a91c8aa50d1d1bff2057dde (diff)
addurl: Fix bug in checking annex.largefiles expressions using largerthan, mimetype, and smallerthan; the first two always failed to match, and the latter always matched.
-rw-r--r--CHANGELOG8
-rw-r--r--Command/AddUrl.hs2
-rw-r--r--doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__.mdwn2
-rw-r--r--doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__/comment_1_d598317883753baf02175a3bf866e08a._comment20
4 files changed, 30 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 3777e6d5a..de1a16fb7 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,11 @@
+git-annex (6.20161119) UNRELEASED; urgency=medium
+
+ * addurl: Fix bug in checking annex.largefiles expressions using
+ largerthan, mimetype, and smallerthan; the first two always failed
+ to match, and the latter always matched.
+
+ -- Joey Hess <id@joeyh.name> Mon, 21 Nov 2016 11:27:50 -0400
+
git-annex (6.20161118) unstable; urgency=medium
* git-annex.cabal: Loosen bounds on persistent to allow 2.5, which
diff --git a/Command/AddUrl.hs b/Command/AddUrl.hs
index e32ceb568..9b6ac28ea 100644
--- a/Command/AddUrl.hs
+++ b/Command/AddUrl.hs
@@ -341,7 +341,7 @@ cleanup u url file key mtmp = case mtmp of
Nothing -> go
Just tmp -> do
largematcher <- largeFilesMatcher
- ifM (checkFileMatcher largematcher file)
+ ifM (checkFileMatcher largematcher tmp)
( go
, do
liftIO $ renameFile tmp file
diff --git a/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__.mdwn b/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__.mdwn
index 5b9c76e69..7e900facf 100644
--- a/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__.mdwn
+++ b/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__.mdwn
@@ -37,4 +37,4 @@ cached/staged changes:
"""]]
-
+> [[fixed|done]] --[[Joey]]
diff --git a/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__/comment_1_d598317883753baf02175a3bf866e08a._comment b/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__/comment_1_d598317883753baf02175a3bf866e08a._comment
new file mode 100644
index 000000000..e03e574f3
--- /dev/null
+++ b/doc/bugs/adds_file_destined_for_annex_into_git_in___39__addurl__39__/comment_1_d598317883753baf02175a3bf866e08a._comment
@@ -0,0 +1,20 @@
+[[!comment format=mdwn
+ username="joey"
+ subject="""comment 1"""
+ date="2016-11-21T15:12:54Z"
+ content="""
+It's sufficient to have "* annex.largefiles=(largerthan=100kb)"
+in .gitattributes.
+
+Even "* annex.largefiles=(largerthan=0kb)" will reproduce it.
+
+Ok, I see why.. It's running the largefile matcher on the destination file
+before it renames the temp file to it!
+
+Seems to have been broken this way ever since addurl got largefiles
+support. Testing didn't catch it because it only affects largefiles
+expressions that need to examine the file.
+
+Fixed in git. Audited other checkFileMatcher calls for this problem;
+the rest are ok.
+"""]]