Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Better message handling for non git-initialized directories #1478

Closed
pravj opened this issue Mar 31, 2015 · 1 comment
Closed

Better message handling for non git-initialized directories #1478

pravj opened this issue Mar 31, 2015 · 1 comment

Comments

@pravj
Copy link

pravj commented Mar 31, 2015

Hi there,

Today, I created an application via the web-interface and tried adding the remote for that in the directory I was working in.

I don't do this generally but I forgot to do git-init in that directory and when I attempted the command heroku git:remote -a <application>, the result was nothing.

It assumes that the directory has git initialized already. And doesn't takes care of the error fatal: Not a git repository (or any of the parent directories): .git returned by git.

https://github.com/heroku/heroku/blob/master/lib/heroku/command/git.rb#L47-L59

  #
  # $ heroku git:remote -a example
  # Git remote heroku added
  #
  def remote
    validate_arguments!
    app_info = api.get_app(app).body
    if git('remote').split("\n").include?(remote_name)
      update_git_remote(remote_name, git_url(app_info['name']))
    else
      create_git_remote(remote_name, git_url(app_info['name']))
    end
  end
@jdx
Copy link
Contributor

jdx commented May 6, 2015

this is fixed as part of #1533

@jdx jdx closed this as completed May 6, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants