From 750c4ac6c282d14d19f79e0711f858367da145e4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 15 Sep 2012 19:47:23 -0400 Subject: bugfix: avoid staging but not committing changes to git-annex branch Branch.get is not able to see changes that have been staged to the index but not committed. This is a limitation of git cat-file --batch; when reading from the index, as opposed to from a branch, it does not notice changes made after the first time it reads the index. So, had to revert the changes made in 1f73db3469e29448bcb1520893de11b23da6fb1f to make annex.alwayscommit=false stage changes. Also, ensure that Branch.change and Branch.get always see changes at all points during a commit, by not deleting journal files when staging to the index. Delete them only after committing the branch. Before, there was a race during commits where a different git-annex could see out-of-date info from the branch while a commit was in progress. That's also done when updating the branch to merge in remote branches. In the case where the local git-annex branch has had changes pushed into it that are not yet reflected in the index, and there are journalled changes as well, a merge commit has to be done. --- Locations.hs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'Locations.hs') diff --git a/Locations.hs b/Locations.hs index d68d5fb5f..3e278dcbb 100644 --- a/Locations.hs +++ b/Locations.hs @@ -23,7 +23,6 @@ module Locations ( gitAnnexJournalLock, gitAnnexIndex, gitAnnexIndexLock, - gitAnnexIndexDirty, gitAnnexPidFile, gitAnnexDaemonStatusFile, gitAnnexLogFile, @@ -152,10 +151,6 @@ gitAnnexIndex r = gitAnnexDir r "index" gitAnnexIndexLock :: Git.Repo -> FilePath gitAnnexIndexLock r = gitAnnexDir r "index.lck" -{- Flag file for .git/annex/index. -} -gitAnnexIndexDirty :: Git.Repo -> FilePath -gitAnnexIndexDirty r = gitAnnexDir r "index.dirty" - {- Pid file for daemon mode. -} gitAnnexPidFile :: Git.Repo -> FilePath gitAnnexPidFile r = gitAnnexDir r "daemon.pid" -- cgit v1.2.3