summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-08-31 18:06:49 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-08-31 18:06:49 -0400
commit441a5dfc2fd112fd165b95fb1106f15a1255e72a (patch)
tree856b1ee18a302d8d781b3094833ed5990ee1981d /Command
parentc9629ab97875721c8d36bdaceec25768de610b5e (diff)
graft exported tree into git-annex branch
So it will be available later and elsewhere, even after GC. I first though to use git update-index to do this, but feeding it a line with a tree object seems to always cause it to generate a git subtree merge. So, fell back to using the Git.Tree interface to maniupulate the trees, and not involving the git-annex branch index file at all. This commit was sponsored by Andreas Karlsson.
Diffstat (limited to 'Command')
-rw-r--r--Command/Export.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Command/Export.hs b/Command/Export.hs
index 1310244ac..0df13e489 100644
--- a/Command/Export.hs
+++ b/Command/Export.hs
@@ -70,7 +70,9 @@ seek :: ExportOptions -> CommandSeek
seek o = do
r <- getParsed (exportRemote o)
new <- fromMaybe (error "unknown tree") <$>
- inRepo (Git.Ref.sha (exportTreeish o))
+ -- Dereference the tree pointed to by the branch, commit,
+ -- or tag.
+ inRepo (Git.Ref.tree (exportTreeish o))
old <- getExport (uuid r)
when (length old > 1) $