Skip to content

Conversation

@Rogdham
Copy link

@Rogdham Rogdham commented Nov 16, 2014

When a file with the repo name exists in $GITHOME, exit with an error message.

This gives a proper error message (although I am open to suggestions for a better error message) when the user tries to create a repository but a file with the same name exits.

Example with the default settings (trying to create a repo named receiver, while a file with the same name exists in $GITHOME…):

Before:

$ git clone git@example.com:receiver
Cloning into 'receiver'...
Enter passphrase for key '<snip>': 
mkdir: cannot create directory '/home/git/receiver': File exists
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists

After this PR:

$ git clone git@git.debiantest.local:receiver
Cloning into 'receiver'...
Enter passphrase for key '<snip>': 
Fatal error: invalid repository name.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Do you think the error message should be made more obvious (e.g. by inserting a newline before and after)?

When a file with the repo name exists in $GITHOME, exit with an error message.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant