summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-08-04 14:43:42 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-08-04 14:43:42 -0400
commita9c156e7e70e6ec259a66e5d1f5a029ab9d17b3b (patch)
treeb5d1ee19d863d1ebe4f533cb5bf1cbfbc17480c2
parent1f78c03012fa46bd0e4b0c7af9b70df872f35b0d (diff)
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.
-rw-r--r--Command/Proxy.hs3
-rw-r--r--debian/changelog1
2 files changed, 3 insertions, 1 deletions
diff --git a/Command/Proxy.hs b/Command/Proxy.hs
index 97cfafeaf..d38a94b46 100644
--- a/Command/Proxy.hs
+++ b/Command/Proxy.hs
@@ -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
diff --git a/debian/changelog b/debian/changelog
index 3470f5ce4..d15478796 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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