Code

gitweb: Always display link to blobdiff_plain in git_blobdiff
[git.git] / builtin-push.c
index a824171066b8b02b82ee45030efa7e6ef359b995..2b5e6fa9ed18c20cda264dbaf9df9d3cbac93c0e 100644 (file)
@@ -8,16 +8,16 @@
 
 #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;
+static int all, tags, force, thin = 1;
+static const char *execute;
 
 #define BUF_SIZE (2084)
 static char buffer[BUF_SIZE];
 
-static const char **refspec = NULL;
-static int refspec_nr = 0;
+static const char **refspec;
+static int refspec_nr;
 
 static void add_refspec(const char *ref)
 {
@@ -32,10 +32,8 @@ static int expand_one_ref(const char *ref, const unsigned char *sha1)
        /* Ignore the "refs/" at the beginning of the refname */
        ref += 5;
 
-       if (strncmp(ref, "tags/", 5))
-               return 0;
-
-       add_refspec(strdup(ref));
+       if (!strncmp(ref, "tags/", 5))
+               add_refspec(strdup(ref));
        return 0;
 }
 
@@ -291,7 +289,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;
                }