{"action":"created","comment":{"url":"https://api.github.com/repos/avajs/ava/pulls/comments/63778961","id":63778961,"diff_hunk":"@@ -134,9 +135,10 @@ RunStatus.prototype.prefixTitle = function (file) {\n \tvar separator = ' ' + chalk.gray.dim(figures.pointerSmall) + ' ';\n \n \tvar prefix = path.relative('.', file)\n-\t\t.replace(this.base, '')\n+\t\t.replace(new RegExp('^' + escapeStringRegexp(this.base)), '')","path":"lib/run-status.js","position":13,"original_position":13,"commit_id":"88b74077474fe3475bcc2c788399866b968bddcd","original_commit_id":"88b74077474fe3475bcc2c788399866b968bddcd","user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"body":"@novemberborn to avoid the regex, how about this?\r\n```js\r\n.replace(this.base, function (match, offset, string) {\r\n\tif (offset === 0) {\r\n\t\treturn ''\r\n\t} else {\r\n\t\treturn match\r\n\t}\r\n})\r\n```","created_at":"2016-05-18T20:46:59Z","updated_at":"2016-05-18T20:46:59Z","html_url":"https://github.com/avajs/ava/pull/844#discussion_r63778961","pull_request_url":"https://api.github.com/repos/avajs/ava/pulls/844","_links":{"self":{"href":"https://api.github.com/repos/avajs/ava/pulls/comments/63778961"},"html":{"href":"https://github.com/avajs/ava/pull/844#discussion_r63778961"},"pull_request":{"href":"https://api.github.com/repos/avajs/ava/pulls/844"}}},"pull_request":{"url":"https://api.github.com/repos/avajs/ava/pulls/844","id":70551441,"html_url":"https://github.com/avajs/ava/pull/844","diff_url":"https://github.com/avajs/ava/pull/844.diff","patch_url":"https://github.com/avajs/ava/pull/844.patch","issue_url":"https://api.github.com/repos/avajs/ava/issues/844","number":844,"state":"open","locked":false,"title":"RunStatus#prefixTitle should remove this.base only if it occurs at the beginning of the path","user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"body":"When `this.base` is `/` it ends up replacing the first `/`, joining the first two directories.\r\nBefore this change it  #looked like this:\r\n<img width=\"702\" alt=\"screen shot 2016-05-18 at 16 36 40\" src=\"https://cloud.githubusercontent.com/assets/56902/15365111/efac942c-1d16-11e6-865b-5447a1588afb.png\">\r\n(notice no separator between `backend` and `models`)\r\nBut it should look like this:\r\n<img width=\"703\" alt=\"screen shot 2016-05-18 at 16 35 31\" src=\"https://cloud.githubusercontent.com/assets/56902/15365173/2ae65424-1d17-11e6-8f7d-d3d1b1eb3e30.png\">\r\nUnless I misunderstood `this.base` it should only be replaced if that's what the path begins with.\r\nI didn't add any test because there's no test file for `run-status.js`","created_at":"2016-05-18T15:41:29Z","updated_at":"2016-05-18T20:46:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b22fbe5c9a867b4516cf565b9c2cf33288852a74","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/avajs/ava/pulls/844/commits","review_comments_url":"https://api.github.com/repos/avajs/ava/pulls/844/comments","review_comment_url":"https://api.github.com/repos/avajs/ava/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avajs/ava/issues/844/comments","statuses_url":"https://api.github.com/repos/avajs/ava/statuses/88b74077474fe3475bcc2c788399866b968bddcd","head":{"label":"nfcampos:test-path","ref":"test-path","sha":"88b74077474fe3475bcc2c788399866b968bddcd","user":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"repo":{"id":58666816,"name":"ava","full_name":"nfcampos/ava","owner":{"login":"nfcampos","id":56902,"avatar_url":"https://avatars.githubusercontent.com/u/56902?v=3","gravatar_id":"","url":"https://api.github.com/users/nfcampos","html_url":"https://github.com/nfcampos","followers_url":"https://api.github.com/users/nfcampos/followers","following_url":"https://api.github.com/users/nfcampos/following{/other_user}","gists_url":"https://api.github.com/users/nfcampos/gists{/gist_id}","starred_url":"https://api.github.com/users/nfcampos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfcampos/subscriptions","organizations_url":"https://api.github.com/users/nfcampos/orgs","repos_url":"https://api.github.com/users/nfcampos/repos","events_url":"https://api.github.com/users/nfcampos/events{/privacy}","received_events_url":"https://api.github.com/users/nfcampos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nfcampos/ava","description":"Futuristic test runner :rocket:","fork":true,"url":"https://api.github.com/repos/nfcampos/ava","forks_url":"https://api.github.com/repos/nfcampos/ava/forks","keys_url":"https://api.github.com/repos/nfcampos/ava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nfcampos/ava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nfcampos/ava/teams","hooks_url":"https://api.github.com/repos/nfcampos/ava/hooks","issue_events_url":"https://api.github.com/repos/nfcampos/ava/issues/events{/number}","events_url":"https://api.github.com/repos/nfcampos/ava/events","assignees_url":"https://api.github.com/repos/nfcampos/ava/assignees{/user}","branches_url":"https://api.github.com/repos/nfcampos/ava/branches{/branch}","tags_url":"https://api.github.com/repos/nfcampos/ava/tags","blobs_url":"https://api.github.com/repos/nfcampos/ava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nfcampos/ava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nfcampos/ava/git/refs{/sha}","trees_url":"https://api.github.com/repos/nfcampos/ava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nfcampos/ava/statuses/{sha}","languages_url":"https://api.github.com/repos/nfcampos/ava/languages","stargazers_url":"https://api.github.com/repos/nfcampos/ava/stargazers","contributors_url":"https://api.github.com/repos/nfcampos/ava/contributors","subscribers_url":"https://api.github.com/repos/nfcampos/ava/subscribers","subscription_url":"https://api.github.com/repos/nfcampos/ava/subscription","commits_url":"https://api.github.com/repos/nfcampos/ava/commits{/sha}","git_commits_url":"https://api.github.com/repos/nfcampos/ava/git/commits{/sha}","comments_url":"https://api.github.com/repos/nfcampos/ava/comments{/number}","issue_comment_url":"https://api.github.com/repos/nfcampos/ava/issues/comments{/number}","contents_url":"https://api.github.com/repos/nfcampos/ava/contents/{+path}","compare_url":"https://api.github.com/repos/nfcampos/ava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nfcampos/ava/merges","archive_url":"https://api.github.com/repos/nfcampos/ava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nfcampos/ava/downloads","issues_url":"https://api.github.com/repos/nfcampos/ava/issues{/number}","pulls_url":"https://api.github.com/repos/nfcampos/ava/pulls{/number}","milestones_url":"https://api.github.com/repos/nfcampos/ava/milestones{/number}","notifications_url":"https://api.github.com/repos/nfcampos/ava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nfcampos/ava/labels{/name}","releases_url":"https://api.github.com/repos/nfcampos/ava/releases{/id}","deployments_url":"https://api.github.com/repos/nfcampos/ava/deployments","created_at":"2016-05-12T18:32:08Z","updated_at":"2016-05-12T18:32:09Z","pushed_at":"2016-05-18T16:01:37Z","git_url":"git://github.com/nfcampos/ava.git","ssh_url":"git@github.com:nfcampos/ava.git","clone_url":"https://github.com/nfcampos/ava.git","svn_url":"https://github.com/nfcampos/ava","homepage":"","size":3829,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"avajs:master","ref":"master","sha":"ee76aa9f4f0b6f1e2b838ca2aef2f3e8a30f4493","user":{"login":"avajs","id":8527916,"avatar_url":"https://avatars.githubusercontent.com/u/8527916?v=3","gravatar_id":"","url":"https://api.github.com/users/avajs","html_url":"https://github.com/avajs","followers_url":"https://api.github.com/users/avajs/followers","following_url":"https://api.github.com/users/avajs/following{/other_user}","gists_url":"https://api.github.com/users/avajs/gists{/gist_id}","starred_url":"https://api.github.com/users/avajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avajs/subscriptions","organizations_url":"https://api.github.com/users/avajs/orgs","repos_url":"https://api.github.com/users/avajs/repos","events_url":"https://api.github.com/users/avajs/events{/privacy}","received_events_url":"https://api.github.com/users/avajs/received_events","type":"Organization","site_admin":false},"repo":{"id":26820798,"name":"ava","full_name":"avajs/ava","owner":{"login":"avajs","id":8527916,"avatar_url":"https://avatars.githubusercontent.com/u/8527916?v=3","gravatar_id":"","url":"https://api.github.com/users/avajs","html_url":"https://github.com/avajs","followers_url":"https://api.github.com/users/avajs/followers","following_url":"https://api.github.com/users/avajs/following{/other_user}","gists_url":"https://api.github.com/users/avajs/gists{/gist_id}","starred_url":"https://api.github.com/users/avajs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avajs/subscriptions","organizations_url":"https://api.github.com/users/avajs/orgs","repos_url":"https://api.github.com/users/avajs/repos","events_url":"https://api.github.com/users/avajs/events{/privacy}","received_events_url":"https://api.github.com/users/avajs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avajs/ava","description":"Futuristic JavaScript test runner :rocket:","fork":false,"url":"https://api.github.com/repos/avajs/ava","forks_url":"https://api.github.com/repos/avajs/ava/forks","keys_url":"https://api.github.com/repos/avajs/ava/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avajs/ava/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avajs/ava/teams","hooks_url":"https://api.github.com/repos/avajs/ava/hooks","issue_events_url":"https://api.github.com/repos/avajs/ava/issues/events{/number}","events_url":"https://api.github.com/repos/avajs/ava/events","assignees_url":"https://api.github.com/repos/avajs/ava/assignees{/user}","branches_url":"https://api.github.com/repos/avajs/ava/branches{/branch}","tags_url":"https://api.github.com/repos/avajs/ava/tags","blobs_url":"https://api.github.com/repos/avajs/ava/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avajs/ava/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avajs/ava/git/refs{/sha}","trees_url":"https://api.github.com/repos/avajs/ava/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avajs/ava/statuses/{sha}","languages_url":"https://api.github.com/repos/avajs/ava/languages","stargazers_url":"https://api.github.com/repos/avajs/ava/stargazers","contributors_url":"https://api.github.com/repos/avajs/ava/contributors","subscribers_url":"https://api.github.com/repos/avajs/ava/subscribers","subscription_url":"https://api.github.com/repos/avajs/ava/subscription","commits_url":"https://api.github.com/repos/avajs/ava/commits{/sha}","git_commits_url":"https://api.github.com/repos/avajs/ava/git/commits{/sha}","comments_url":"https://api.github.com/repos/avajs/ava/comments{/number}","issue_comment_url":"https://api.github.com/repos/avajs/ava/issues/comments{/number}","contents_url":"https://api.github.com/repos/avajs/ava/contents/{+path}","compare_url":"https://api.github.com/repos/avajs/ava/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avajs/ava/merges","archive_url":"https://api.github.com/repos/avajs/ava/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avajs/ava/downloads","issues_url":"https://api.github.com/repos/avajs/ava/issues{/number}","pulls_url":"https://api.github.com/repos/avajs/ava/pulls{/number}","milestones_url":"https://api.github.com/repos/avajs/ava/milestones{/number}","notifications_url":"https://api.github.com/repos/avajs/ava/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avajs/ava/labels{/name}","releases_url":"https://api.github.com/repos/avajs/ava/releases{/id}","deployments_url":"https://api.github.com/repos/avajs/ava/deployments","created_at":"2014-11-18T17:20:26Z","updated_at":"2016-05-18T19:49:40Z","pushed_at":"2016-05-18T16:06:12Z","git_url":"git://github.com/avajs/ava.git","ssh_url":"git@github.com:avajs/ava.git","clone_url":"https://github.com/avajs/ava.git","svn_url":"https://github.com/avajs/ava","homepage":"","size":4383,"stargazers_count":4695,"watchers_count":4695,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":194,"mirror_url":null,"open_issues_count":106,"forks":194,"open_issues":106,"watchers":4695,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avajs/ava/pulls/844"},"html":{"href":"https://github.com/avajs/ava/pull/844"},"issue":{"href":"https://api.github.com/repos/avajs/ava/issues/844"},"comments":{"href":"https://api.github.com/repos/avajs/ava/issues/844/comments"},"review_comments":{"href":"https://api.github.com/repos/avajs/ava/pulls/844/comments"},"review_comment":{"href":"https://api.github.com/repos/avajs/ava/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avajs/ava/pulls/844/commits"},"statuses":{"href":"https://api.github.com/repos/avajs/ava/statuses/88b74077474fe3475bcc2c788399866b968bddcd"}}}}