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

Fix support for getting single files from GitHub (v2) #356

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Commits on Aug 3, 2022

  1. Fix support for getting single files from GitHub

    This currently fails for GitHub (and possibly other Git repositories)
    because there is an assumption in the "client.go" file that the "subDir"
    segment is always a directory.
    
    However, for this URL:
    
    https://github.com/owner/repo/subdir/file.txt
    
    The "subDir" variable would actually be a file ("subdir/file.txt") and
    hence the client should use "copyFile" rather than "copyDir" when
    copying the "subDir" to the final destination.
    
    This change fixes that to check whether the "subDir" variable is a file
    or a directory, and appropriately uses "copyDir" or "copyFile". It also
    returns the single file in the "GetResult" object, if indeed a single
    file was requested.
    
    Tests attached.
    arikkfir committed Aug 3, 2022
    Configuration menu
    Copy the full SHA
    66abd65 View commit details
    Browse the repository at this point in the history