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

Use git remote url to determine nwo #45

Merged
merged 8 commits into from Mar 24, 2016
Merged

Use git remote url to determine nwo #45

merged 8 commits into from Mar 24, 2016

Conversation

benbalter
Copy link
Contributor

Fixes #44

@parkr any idea how to properly mock the git_remote_url method?

end

it "grabs the git nwo from an HTTPS url" do
subject.class.any_instance.stub(:git_remote_url) { "htps://github.com/foo/bar" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allow(subject).to receive(:git_remote_url).and_return("https://github.com/foo/bar")

@benbalter
Copy link
Contributor Author

Ahh. Google was failing me. Thanks @parkr fixed.

@benbalter
Copy link
Contributor Author

To note, my motivation for this, is if this plugin is included by default via the pages gem, that means that without this fix, sites will fail to build by default, since they don't specify a repository in the config.

end

it "retrieves the git remote" do
expect(subject.send(:git_remote_url)).to include("jekyll/github-metadata")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to fail. Think it's hitting your stub on line 23?

https://travis-ci.org/jekyll/github-metadata/jobs/117149521#L232

@parkr
Copy link
Member

parkr commented Mar 24, 2016

@benbalter Due to git/git@96f78d3#diff-388838443870b4d1c62785151773c6ff being relatively new, I think going the route of the olden days (git remote -v and grepping) is our best bet for greatest compatibility.

@parkr
Copy link
Member

parkr commented Mar 24, 2016

@jekyllbot: merge

@jekyllbot jekyllbot merged commit 039dc95 into master Mar 24, 2016
@jekyllbot jekyllbot deleted the use-git-remote-url branch March 24, 2016 22:56
jekyllbot added a commit that referenced this pull request Mar 24, 2016
@ctubbsii
Copy link

What version is this fixed in? I don't see a milestone marked on the GitHub issue.

@parkr
Copy link
Member

parkr commented Apr 20, 2016

@ctubbsii
Copy link

Looks like this is still a problem with auto-rebuilds when running jekyll serve, at least with jekyll-github-metadata 2.2.0.

simonis added a commit to simonis/cl4cds that referenced this pull request Dec 28, 2017
 - need to set 'repository: simonis/cl4cds' if there's no git available or git is too old to understand 'git remote get-url origin' (see jekyll/github-metadata#45)
 - have to use jekyll/jekyll:latest Docker image as jekyll/jekyll:pages doesn't seem to work anymore (see envygeeks/jekyll-docker#198)
@jekyll jekyll locked and limited conversation to collaborators Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Try to get repository name from git branch, when available
4 participants