Skip to content

Commit

Permalink
Merge pull request #74 from datalad/bf-72
Browse files Browse the repository at this point in the history
(Temporarily?) discontinue probing remotes for XDLRA--refs
  • Loading branch information
mih authored Jun 9, 2022
2 parents 8fd1dd7 + fb9be62 commit de5e4cb
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions datalad_next/gitremote/datalad_annex.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,18 +895,38 @@ def get_remote_refs(self):
# remote, but URLs for the two individual keys
sremotes = ra.get_special_remotes()

if len(sremotes) == 1 and not call_annex_success(ra, [
'fsck', '-f', 'origin', '--fast',
'--key', self.refs_key]):
# the remote reports nothing, we can exit
# we use `fsck`, rather than `whereis` to bypass
# the local state tracking
return
# disable the useless download prevention due to
# https://github.com/datalad/datalad-next/issues/72
#if len(sremotes) == 1 and not call_annex_success(ra, [
# 'fsck', '-f', 'origin', '--fast',
# '--key', self.refs_key]):
# # the remote reports nothing, we can exit
# # we use `fsck`, rather than `whereis` to bypass
# # the local state tracking
# return
#
# instead pretend that the remote has this key and let things
# fail-on-get below if that is not the case
if len(sremotes) == 1:
# in case of the 'web' special remote, we have no actual special
# remote, but URLs for the two individual keys
ra.call_annex(['setpresentkey', self.refs_key,
sremotes.popitem()[0], '1'])

# we have to get the key, and report its content
# force redownload, by dropping the local content first
ra.call_annex([
'drop', '--force', '--key', self.refs_key])
ra.call_annex(['get', '--key', self.refs_key])
# try download -- try, because we fakes availability above -- without
# which the `get` would not be attempted
try:
ra.call_annex(['get', '--key', self.refs_key])
except CommandError as e:
CapturedException(e)
self.log("Remote reports no refs")
# download failed, we have no refs
return

refskeyloc = ra.call_annex_oneline([
'contentlocation', self.refs_key])
# read, cache, return
Expand Down

0 comments on commit de5e4cb

Please sign in to comment.