git-annex/Annex
Joey Hess 3d8355d984 Fix a bug in the git-annex branch handling code that could cause info from a remote to not be merged and take effect immediately.
This bug was turned up by the test suite, running fsck in direct mode.
A repository was cloned, was put into direct mode, was fscked, and fsck
incorrectly said that no copy existed of a file, that was actually present
in origin.

This turned out to occur because fsck first did a Annex.Branch.change,
recording that it did not locally have the file. That was recorded in the
journal. Since neither the git annex direct not the fsck had yet needed to
read any info from the branch, but had only made changes to it, the
origin/git-annex branch was not yet merged in. So the journal got a
location log entry written to it, but this did not include
the location log info for the origin. When fsck then did a
Annex.Branch.get, it trusted the journal was cosnsitent, and returned it,
again w/o merging from origin/git-annex. This latter behavior is the
actual bug.

Refer to commit e9bfa8eaed for the thinking
behind it being ok to make a change to a file on the branch, without
first merging the branch. That thinking still stands. However, it means
that files in the journal cannot be trusted to be consistent if the branch
has not been merged. So, to fix, just enure the branch gets merged, even
when reading from the journal.

In tests, this does not seem to cause any extra merging. Except, of course,
in the one case described above. But git annex add, etc, are able to make
changes w/o first merging the branch.
2013-05-20 15:14:59 -04:00
..
Content store copy in inode cache too 2013-05-17 16:16:10 -04:00
Branch.hs Fix a bug in the git-annex branch handling code that could cause info from a remote to not be merged and take effect immediately. 2013-05-20 15:14:59 -04:00
BranchState.hs remove git-annex branch read cache 2012-10-19 14:25:15 -04:00
CatFile.hs Merge branch 'master' into windows 2013-05-15 19:18:04 -04:00
CheckAttr.hs finished where indentation changes 2012-12-13 00:24:19 -04:00
Content.hs improve handling of receiving object in direct mode when associated files are modified 2013-05-17 16:25:18 -04:00
Direct.hs minor optimisation and warning fix 2013-05-20 13:58:41 -04:00
Environment.hs fix warnings 2013-05-13 15:30:18 -04:00
Exception.hs Switch to MonadCatchIO-transformers for better handling of state while catching exceptions. 2013-05-19 14:16:36 -04:00
FileMatcher.hs per-IA-item content directories 2013-04-25 23:44:55 -04:00
Journal.hs fix the day's windows permissions damage 2013-05-12 19:09:48 -04:00
Link.hs fix the day's Windows permissions damage 2013-05-14 20:15:14 -04:00
LockPool.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Perms.hs fix permission damage (thanks, Windows) 2013-05-11 23:54:25 -04:00
Queue.hs type based git config handling for remotes 2013-01-01 13:58:14 -04:00
ReplaceFile.hs test suite passes in direct mode 2013-05-17 15:59:37 -04:00
Ssh.hs fix imports 2013-05-14 13:53:29 -04:00
TaggedPush.hs expose Control.Monad.join 2013-04-22 20:24:53 -04:00
UUID.hs Now uses the Haskell uuid library, rather than needing a uuid program. 2013-02-10 14:52:54 -04:00
Version.hs git-annex now builds on Windows (doesn't work) 2013-05-11 15:03:00 -05:00
Wanted.hs --auto fixes 2012-12-06 13:22:16 -04:00