{"thread":{"id":"14769","subject":"[FUN PATCH] Remove \"git clone\" parameters if they are the first in a git clone call","startedAt":"2008-07-30T23:02:09Z","lastAt":"2008-07-30T23:02:09Z","messageCount":1,"participants":["Pieter de Bie"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"85704","messageId":"1217458929-84974-1-git-send-email-pdebie@ai.rug.nl","threadId":"14769","inReplyTo":null,"subject":"[FUN PATCH] Remove \"git clone\" parameters if they are the first in a git clone call","fromName":"Pieter de Bie","fromEmail":"pdebie@ai.rug.nl","sentAt":"2008-07-30T23:02:09Z","receivedAt":"2008-07-30T23:02:09Z","isPatch":true,"sender":{"key":"pdebie@ai.rug.nl","avatar":null},"body":"This removes accidental duplicate \"git clone\" parameters, for example\nwhen typing:\n\n  git clone git clone git://repo.or.cz/git.git\n\n---\n\nOK, so it happens often to me that I copy a line that already starts with \"git\nclone\", and then type it myself again, paste, and hit enter. I thought it\nmight happen to others too, hence this patch.\n\n\n builtin-clone.c |    5 +++++\n 1 files changed, 5 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-clone.c b/builtin-clone.c\nindex 4b1ab36..9e4c7c2 100644\n--- a/builtin-clone.c\n+++ b/builtin-clone.c\n@@ -350,6 +350,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)\n \n \tjunk_pid = getpid();\n \n+\tif (argc > 3 && !strcmp(argv[1], \"git\") && !strcmp(argv[2], \"clone\")) {\n+\t\targv += 2;\n+\t\targc -= 2;\n+\t}\n+\n \targc = parse_options(argc, argv, builtin_clone_options,\n \t\t\t     builtin_clone_usage, 0);\n \n-- \n1.6.0.rc1.163.g8ec19\n"}]}