git-remote-annex working
A few bugfixes. Have not tested extensively, but a push followed by a clone worked. Sponsored-by: Nicholas Golder-Manning on Patreon
This commit is contained in:
parent
3039331529
commit
ef5e9aa082
1 changed files with 8 additions and 4 deletions
|
@ -32,6 +32,7 @@ import Git.Types
|
||||||
import Logs.Difference
|
import Logs.Difference
|
||||||
import Annex.Init
|
import Annex.Init
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
|
import Annex.Perms
|
||||||
import Remote.List
|
import Remote.List
|
||||||
import Remote.List.Util
|
import Remote.List.Util
|
||||||
import Utility.Tmp
|
import Utility.Tmp
|
||||||
|
@ -185,6 +186,7 @@ push :: State -> Remote -> [String] -> Annex ([String], State)
|
||||||
push st rmt ls = do
|
push st rmt ls = do
|
||||||
let (refspecs, ls') = collectRefSpecs ls
|
let (refspecs, ls') = collectRefSpecs ls
|
||||||
(responses, trackingrefs) <- calc refspecs ([], trackingRefs st)
|
(responses, trackingrefs) <- calc refspecs ([], trackingRefs st)
|
||||||
|
updateTrackingRefs rmt trackingrefs
|
||||||
(ok, st') <- if M.null trackingrefs
|
(ok, st') <- if M.null trackingrefs
|
||||||
then pushEmpty st rmt
|
then pushEmpty st rmt
|
||||||
else if any forcedPush refspecs
|
else if any forcedPush refspecs
|
||||||
|
@ -195,10 +197,10 @@ push st rmt ls = do
|
||||||
if ok
|
if ok
|
||||||
then do
|
then do
|
||||||
sendresponses responses
|
sendresponses responses
|
||||||
-- Update the tracking refs to reflect the push.
|
|
||||||
updateTrackingRefs rmt trackingrefs
|
|
||||||
return (ls', st' { trackingRefs = trackingrefs })
|
return (ls', st' { trackingRefs = trackingrefs })
|
||||||
else do
|
else do
|
||||||
|
-- Restore the old tracking refs
|
||||||
|
updateTrackingRefs rmt (trackingRefs st)
|
||||||
sendresponses $
|
sendresponses $
|
||||||
map (const "error push failed") refspecs
|
map (const "error push failed") refspecs
|
||||||
return (ls', st')
|
return (ls', st')
|
||||||
|
@ -271,7 +273,7 @@ fullPush st rmt refs = guardPush st $ do
|
||||||
guardPush :: State -> Annex (Bool, State) -> Annex (Bool, State)
|
guardPush :: State -> Annex (Bool, State) -> Annex (Bool, State)
|
||||||
guardPush st a = catchNonAsync a $ \ex -> do
|
guardPush st a = catchNonAsync a $ \ex -> do
|
||||||
liftIO $ hPutStrLn stderr $
|
liftIO $ hPutStrLn stderr $
|
||||||
"Push faild (" ++ show ex ++ ")"
|
"Push failed (" ++ show ex ++ ")"
|
||||||
return (False, st { manifestCache = Nothing })
|
return (False, st { manifestCache = Nothing })
|
||||||
|
|
||||||
-- Incremental push of only the refs that changed.
|
-- Incremental push of only the refs that changed.
|
||||||
|
@ -591,7 +593,9 @@ uploadManifest rmt manifest =
|
||||||
-- is configured to require only cryptographically secure
|
-- is configured to require only cryptographically secure
|
||||||
-- keys, which it is not.
|
-- keys, which it is not.
|
||||||
objfile <- calcRepo (gitAnnexLocation mk)
|
objfile <- calcRepo (gitAnnexLocation mk)
|
||||||
unlessM (isJust <$> linkOrCopy mk (toRawFilePath tmp) objfile Nothing)
|
res <- modifyContentDir objfile $
|
||||||
|
linkOrCopy mk (toRawFilePath tmp) objfile Nothing
|
||||||
|
unless (isJust res)
|
||||||
uploadfailed
|
uploadfailed
|
||||||
-- noRetry because manifest content is not stable
|
-- noRetry because manifest content is not stable
|
||||||
ok <- upload rmt mk (AssociatedFile Nothing)
|
ok <- upload rmt mk (AssociatedFile Nothing)
|
||||||
|
|
Loading…
Reference in a new issue