git-push: allow -f as an alias for --force

This was already documented in the options section of the manpage. This
patch implements it, adds it to the usage message, and mentions it at the
top of the manpage.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Jeff King 2006-08-02 11:28:16 -04:00 коммит произвёл Junio C Hamano
Родитель 822a7d5071
Коммит 8f615493e6
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -8,7 +8,7 @@ git-push - Update remote refs along with associated objects
SYNOPSIS
--------
'git-push' [--all] [--tags] [--force] <repository> <refspec>...
'git-push' [--all] [--tags] [-f | --force] <repository> <refspec>...
DESCRIPTION
-----------

Просмотреть файл

@ -8,7 +8,7 @@
#define MAX_URI (16)
static const char push_usage[] = "git push [--all] [--tags] [--force] <repository> [<refspec>...]";
static const char push_usage[] = "git push [--all] [--tags] [-f | --force] <repository> [<refspec>...]";
static int all = 0, tags = 0, force = 0, thin = 1;
static const char *execute = NULL;
@ -291,7 +291,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
tags = 1;
continue;
}
if (!strcmp(arg, "--force")) {
if (!strcmp(arg, "--force") || !strcmp(arg, "-f")) {
force = 1;
continue;
}