add: Avoid a failure mode that resulted in the file seemingly being deleted (content put in the annex but no symlink present).

This commit is contained in:
Joey Hess 2011-07-07 19:29:36 -04:00
parent ff531b9677
commit 67dcc1f171
3 changed files with 8 additions and 2 deletions

View file

@ -51,11 +51,11 @@ perform (file, backend) = do
cleanup :: FilePath -> Key -> CommandCleanup
cleanup file key = do
logStatus key InfoPresent
link <- calcGitLink file key
liftIO $ createSymbolicLink link file
logStatus key InfoPresent
-- touch the symlink to have the same mtime as the file it points to
s <- liftIO $ getFileStatus file
let mtime = modificationTime s

2
debian/changelog vendored
View file

@ -4,6 +4,8 @@ git-annex (3.20110706) UNRELEASED; urgency=low
* Bugfix: Forgot to de-escape keys when upgrading. Could result in
bad location log data for keys that contain [&:%] in their names.
(A workaround for this problem is to run git annex fsck.)
* add: Avoid a failure mode that resulted in the file seemingly being
deleted (content put in the annex but no symlink present).
-- Joey Hess <joeyh@debian.org> Tue, 05 Jul 2011 20:52:11 -0400

View file

@ -8,3 +8,7 @@ Recently I ran into the following situation under Ubuntu with an encrypted home
The file seems to be completely gone. It no longer exists in the current directory, or under .git/annex.
I don't mind horribly that git-annex failed due to the name length limit, but it shouldn't have deleted my file in the process (fortunately the file wasn't very important, or hard to recover).
> [[done]], as noted it did not delete content and now it makes the symlink
> before trying to write to the location log, avoiding that gotcha.
> --[[Joey]]