sync: Fix crash when there are submodules and an adjusted branch is checked out

Reverse adjusting the branch uses treeItemToTreeContent, which was missed
when adding submodule support earlier.
This commit is contained in:
Joey Hess 2019-10-23 11:52:56 -04:00
parent 70b306ec34
commit bbdeb1a1a8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 9 additions and 3 deletions

View file

@ -3,6 +3,8 @@ git-annex (7.20191018) UNRELEASED; urgency=medium
* init: Fix a failure when used in a submodule on a crippled filesystem.
* enable-tor: Deal with pkexec changing to root's home directory
when running a command.
* sync: Fix crash when there are submodules and an adjusted branch is
checked out.
-- Joey Hess <id@joeyh.name> Mon, 21 Oct 2019 11:01:06 -0400

View file

@ -127,7 +127,9 @@ data TreeItem = TreeItem TopFilePath FileMode Sha
deriving (Show, Eq)
treeItemToTreeContent :: TreeItem -> TreeContent
treeItemToTreeContent (TreeItem f m s) = TreeBlob f m s
treeItemToTreeContent (TreeItem f m s) = case toTreeItemType m of
Just TreeSubmodule -> TreeCommit f m s
_ -> TreeBlob f m s
treeItemToLsTreeItem :: TreeItem -> LsTree.TreeItem
treeItemToLsTreeItem (TreeItem f mode sha) = LsTree.TreeItem

View file

@ -51,3 +51,5 @@ upgrade supported from repository
[[ben]]
[[!tag confirmed]]
> [[fixed|done]] --[[Joey]]