Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Repository discovery starting from files #3998

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

Merged
merged 5 commits into from
Nov 14, 2016

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Nov 11, 2016

This PR is as a response to #3994. I think it does make sense to make a repository discoverable even if initially, a path to a file inside the repository was specified.

When trying to find a discovery, we walk up the directory
structure checking if there is a ".git" file or directory and, if
so, check its validity. But in the case that we've got a ".git"
file, we do not want to unconditionally assume that the file is
in fact a ".git" file and treat it as such, as we would error out
if it is not.

Fix the issue by only treating a file as a gitlink file if it
ends with "/.git". This allows users of the function to discover
a repository by handing in any path contained inside of a git
repository.
@pks-t pks-t force-pushed the pks/repo-discovery branch from 78c9584 to 0f31609 Compare November 14, 2016 09:53
@ethomson
Copy link
Member

This looks 👍 to me, this seems quite low risk for 0.25, @carlosmn do you agree?

@carlosmn carlosmn merged commit a39f18a into libgit2:master Nov 14, 2016
@carlosmn
Copy link
Member

Yeah, since this was apparently working before, I suppose not supporting it would technically break the API.

@pks-t pks-t deleted the pks/repo-discovery branch November 15, 2016 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants