gitreceive icon indicating copy to clipboard operation
gitreceive copied to clipboard

Error message for repo creation when file exits

Open Rogdham opened this issue 11 years ago • 0 comments

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 [email protected]: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 [email protected]: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)?

Rogdham avatar Nov 16 '14 13:11 Rogdham