Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST+BF: download_url: Don't try to infer dataset if save=False #3029

Merged
merged 1 commit into from Nov 29, 2018

Commits on Nov 28, 2018

  1. TST+BF: download_url: Don't try to infer dataset if save=False

    When a dataset isn't explicitly specified, download_url will try to
    infer one from the current directory.  However, if save is False,
    there's no reason to do so.  Trying to infer the dataset in these
    situations generally won't hurt, but doing so may unnecessarily fail
    in the save=False case if the current directory is something that may
    cause issues when used as a dataset (e.g., a git worktree).
    
    Note: This was prompted by a download_url test failing when ran from a
    worktree (dataladgh-3028).  The most direct solution is to use chpwd() to get
    to a non-dataset directory in the cases that we call
    api.download_url(dataset=None), but that wouldn't help for callers
    outside the test.  Another would be to catch the repository exception
    around the require_dataset() call, but I've found that, when calling
    `datalad download-url` from a worktree, the exception may be raised
    downstream rather than at the require_dataset() call.
    
    Fixes datalad#3028.
    kyleam committed Nov 28, 2018
    Configuration menu
    Copy the full SHA
    f295715 View commit details
    Browse the repository at this point in the history