kamranahmedse / git-first

Chrome Extension – Takes you to the first commit of a GitHub repository
http://bit.ly/git-first
MIT License
68 stars 8 forks source link

sha is always null #3

Closed baxter2 closed 4 years ago

baxter2 commented 5 years ago

At the moment no matter what url is given sha is always equal to null.

This means fetchFirstCommit({ owner, repo, sha }) is never utilising the sha option to start listing commits from specified SHA or branch.

// https://github.com/7compass/sentimental
// This one you do want it to be null
fetchFirstCommit({ "7compass", "sentimental", null })

// https://github.com/7compass/sentimental/tree/3f79fa454349a4fde89d189f7bca6879876684f7
fetchFirstCommit({ "7compass", "sentimental", null })

// https://github.com/7compass/sentimental/commit/3f79fa454349a4fde89d189f7bca6879876684f7
fetchFirstCommit({ "7compass", "sentimental", null })

// https://github.com/7compass/sentimental/find/master
fetchFirstCommit({ "7compass", "sentimental", null })

// https://github.com/7compass/sentimental/blob/master/Gemfile
fetchFirstCommit({ "7compass", "sentimental", null })

PR #2 fixes this issue by assigning sha a SHA or branch.

// https://github.com/7compass/sentimental
// This one you do want it to be null
fetchFirstCommit({ "7compass", "sentimental", null })

// https://github.com/7compass/sentimental/tree/3f79fa454349a4fde89d189f7bca6879876684f7
fetchFirstCommit({ "7compass", "sentimental", "3f79fa454349a4fde89d189f7bca6879876684f7" })

// https://github.com/7compass/sentimental/commit/3f79fa454349a4fde89d189f7bca6879876684f7
fetchFirstCommit({ "7compass", "sentimental", "3f79fa454349a4fde89d189f7bca6879876684f7" })

// https://github.com/7compass/sentimental/find/master
fetchFirstCommit({ "7compass", "sentimental", "master" })

// https://github.com/7compass/sentimental/blob/master/Gemfile
fetchFirstCommit({ "7compass", "sentimental", "master" })
kamranahmedse commented 4 years ago

Thank you, this will be deployed in the next release.