# Docker-manager plugin not linking to github properly

**URL:** <https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308>\
**Category:** Bug\
**Created:** [01.Ноябрь.2016 16:47:11 UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308 "2016-11-01T16:47:11Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [02.Ноябрь.2016 00:11:54 UTC](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308/5 "2016-11-02T00:11:54Z")

</div>

Think I’ve tracked it down. It breaks for repositories that have been cloned without the URL ending in `.git`

(I cloned by doing `git clone https://github.com/discourse/discourse-push-notifications` instead of `https://github.com/discourse/discourse-push-notifications.git`)

I believe the line causing this is line 9 here:  
[https://github.com/discourse/docker\_manager/blob/master/manager-client/app/helpers/fmt-commit.js#L9](https://github.com/discourse/docker_manager/blob/master/manager-client/app/helpers/fmt-commit.js#L9)

If the URL doesn’t contain `.git` then `url.indexOf` returns -1, and so `url.substr(0,-1)` returns an empty string.

Something like this might work (but there’s probably a tidier way):

```plaintext
var extension = url.indexOf('.git')
if (extension == -1){
    var _url = url  	
}else{
    var _url = url.substr(0, extension);	
}

```

Unfortunately I can’t manage to build `docker-manager/manager-client` in my dev environment so I can’t test this or do a pull request ☹

---

_[View the full topic](https://meta.discourse.org/t/docker-manager-plugin-not-linking-to-github-properly/52308)._
