Merge branch 'pk/fast-import-tars'
[gitweb.git] / builtin-push.c
index 67f6d96fbeb180b6438172207ff5290c7344cc67..6eda372a55ec72e1a26119ffdff0dd69456bdcf5 100644 (file)
@@ -157,10 +157,10 @@ static int do_push(const char *repo, int flags)
                        continue;
 
                error("failed to push some refs to '%s'", url[i]);
-               if (nonfastforward) {
-                       printf("To prevent you from losing history, non-fast-forward updates were rejected.\n"
-                              "Merge the remote changes before pushing again.\n"
-                              "See 'non-fast forward' section of 'git push --help' for details.\n");
+               if (nonfastforward && advice_push_nonfastforward) {
+                       printf("To prevent you from losing history, non-fast-forward updates were rejected\n"
+                              "Merge the remote changes before pushing again.  See the 'non-fast forward'\n"
+                              "section of 'git push --help' for details.\n");
                }
                errs++;
        }