proxy: Fix removal of files deleted by the proxied command.

Git.Ref.headSha doesn't really work in direct mode as there's not a head,
so it was actually diffing against the empty tree and so not removing any
deleted files. Get the sha of the current branch instead, which is the same
thing Command.Sync does.
This commit is contained in:
Joey Hess 2015-08-04 14:43:42 -04:00
parent 2abd248cf2
commit c812018cc5
2 changed files with 3 additions and 1 deletions

View file

@ -41,7 +41,8 @@ start (c:ps) = liftIO . exitWith =<< ifM isDirect
where
go tmp = do
oldref <- fromMaybe Git.Sha.emptyTree
<$> inRepo Git.Ref.headSha
<$> (inRepo . maybe Git.Ref.headSha Git.Ref.sha
=<< inRepo Git.Branch.currentUnsafe)
setuptmpworktree tmp
exitcode <- proxy tmp

1
debian/changelog vendored
View file

@ -15,6 +15,7 @@ git-annex (5.20150732) UNRELEASED; urgency=medium
* proxy: If a non-proxied git command, such as git revert
would normally fail because of unstaged files in the work tree,
make the proxied command fail the same way.
* proxy: Fix removal of files deleted by the proxied command.
-- Joey Hess <id@joeyh.name> Fri, 31 Jul 2015 12:31:39 -0400