repair: Improve fetching from a remote with an url in host:path format.
User reported git@my.gitlab.foo:username/myrepo.git didn't work with git-repair, because it rewrites it to an url ssh://git@my.gitlab.foo/~/username/myrepo.git and the /~/ was not something the hosting site supported. Since git-annex still generally needs the repo url to be well, an url, did not change the conversion code. But in this case, we're running git fetch, so we might as well pass it the remote name rather than the url. Did a quick audit of repoLocation uses to see if there was anything else like this problem elsewhere, and didn't see any. But this is not the first time this special case in git and git-annex's attempt to de-special-case it has caused a problem..
This commit is contained in:
parent
d2e78dfc0d
commit
dfc4e641b5
2 changed files with 18 additions and 15 deletions
|
@ -122,24 +122,26 @@ retrieveMissingObjects missing referencerepo r
|
|||
)
|
||||
pullremotes tmpr (rmt:rmts) fetchrefs ms
|
||||
| not (foundBroken ms) = return ms
|
||||
| otherwise = do
|
||||
putStrLn $ "Trying to recover missing objects from remote " ++ repoDescribe rmt ++ "."
|
||||
ifM (fetchfrom (repoLocation rmt) fetchrefs tmpr)
|
||||
( do
|
||||
void $ explodePacks tmpr
|
||||
void $ copyObjects tmpr r
|
||||
case ms of
|
||||
FsckFailed -> pullremotes tmpr rmts fetchrefs ms
|
||||
FsckFoundMissing s t -> do
|
||||
stillmissing <- findMissing (S.toList s) r
|
||||
pullremotes tmpr rmts fetchrefs (FsckFoundMissing stillmissing t)
|
||||
, pullremotes tmpr rmts fetchrefs ms
|
||||
)
|
||||
fetchfrom fetchurl ps fetchr = runBool ps' fetchr'
|
||||
| otherwise = case remoteName rmt of
|
||||
Just n -> do
|
||||
putStrLn $ "Trying to recover missing objects from remote " ++ n ++ "."
|
||||
ifM (fetchfrom n fetchrefs tmpr)
|
||||
( do
|
||||
void $ explodePacks tmpr
|
||||
void $ copyObjects tmpr r
|
||||
case ms of
|
||||
FsckFailed -> pullremotes tmpr rmts fetchrefs ms
|
||||
FsckFoundMissing s t -> do
|
||||
stillmissing <- findMissing (S.toList s) r
|
||||
pullremotes tmpr rmts fetchrefs (FsckFoundMissing stillmissing t)
|
||||
, pullremotes tmpr rmts fetchrefs ms
|
||||
)
|
||||
Nothing -> pullremotes tmpr rmts fetchrefs ms
|
||||
fetchfrom loc ps fetchr = runBool ps' fetchr'
|
||||
where
|
||||
ps' =
|
||||
[ Param "fetch"
|
||||
, Param fetchurl
|
||||
, Param loc
|
||||
, Param "--force"
|
||||
, Param "--update-head-ok"
|
||||
, Param "--quiet"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue