diff --git a/Annex/WorkTree.hs b/Annex/WorkTree.hs index c37bfa14db..2c1171f63f 100644 --- a/Annex/WorkTree.hs +++ b/Annex/WorkTree.hs @@ -73,13 +73,13 @@ ifAnnexed file yes no = maybe no yes =<< lookupFile file - - This is expensive, and so normally the associated files are updated - incrementally when changes are noticed. So, this only needs to be done - - when initializing/upgrading a v6 mode repository. + - when initializing/upgrading a v6+ mode repository. - - Also, the content for the unlocked file may already be present as - an annex object. If so, make the unlocked file use that content. -} scanUnlockedFiles :: Annex () -scanUnlockedFiles = whenM (isJust <$> inRepo Git.Branch.current) $ do +scanUnlockedFiles = whenM (inRepo $ Git.Ref.exists Git.Ref.headRef) $ do showSideAction "scanning for unlocked files" Database.Keys.runWriter $ liftIO . Database.Keys.SQL.dropAllAssociatedFiles diff --git a/CHANGELOG b/CHANGELOG index b733835e32..1471d096ed 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,8 @@ git-annex (7.20190709) UNRELEASED; urgency=medium parsing. * Add BLAKE2BP512 and BLAKE2BP512E backends, using a blake2 variant optimised for 4-way CPUs. + * Support running v7 upgrade in a repo where there is no branch checked + out, but HEAD is set directly to some other ref. -- Joey Hess Mon, 08 Jul 2019 08:59:54 -0400 diff --git a/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD.mdwn b/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD.mdwn index 7a800d0c1d..983385ba7e 100644 --- a/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD.mdwn +++ b/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD.mdwn @@ -54,3 +54,5 @@ as you can see the arg-test.sim is only 68 bytes, not 2MB or a symlink. [[!meta author=yoh]] + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD/comment_3_cd7cc008c3d37caa76416bd2452da90d._comment b/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD/comment_3_cd7cc008c3d37caa76416bd2452da90d._comment new file mode 100644 index 0000000000..16434ff7fc --- /dev/null +++ b/doc/bugs/get_fails_to_place_v7_unlocked_file_content_into_the_file_tree_in_v7_in_repo_with_detached_HEAD/comment_3_cd7cc008c3d37caa76416bd2452da90d._comment @@ -0,0 +1,21 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 3""" + date="2019-07-16T16:13:49Z" + content=""" +I notice that the keys database is not populated in the clone. + +Also, the upgrade does not display "scanning for unlocked files". +And in Annex.WorkTree, we can see why: + + scanUnlockedFiles = whenM (isJust <$> inRepo Git.Branch.current) $ do + showSideAction "scanning for unlocked files" + +There is no current git branch in this case. + +That check was added in [[!commit 9b995954731e05727d77c7bff487af10da9cb4b9]] +"only do scan when there's a branch, not in freshly created new repo" + +Since it does a ls-tree of HEAD, what it really ought to check for is that +HEAD is set, which it's not in a fresh new repo. Done. +"""]]