Update the tracking references only if they were succesfully updated on remote
[gitweb.git] / send-pack.c
index 5e127a1b7b33bdc9aaafc80873c5c987573566bd..d56d980af7af9466cd8b13433f5fd3badadd0d98 100644 (file)
@@ -297,9 +297,9 @@ static int send_pack(int in, int out, struct remote *remote, int nr_refspec, cha
                                 * commits at the remote end and likely
                                 * we were not up to date to begin with.
                                 */
-                               error("remote '%s' is not a strict "
-                                     "subset of local ref '%s'. "
-                                     "maybe you are not up-to-date and "
+                               error("remote '%s' is not an ancestor of\n"
+                                     " local  '%s'.\n"
+                                     " Maybe you are not up-to-date and "
                                      "need to pull first?",
                                      ref->name,
                                      ref->peer_ref->name);
@@ -349,7 +349,8 @@ static int send_pack(int in, int out, struct remote *remote, int nr_refspec, cha
 
        if (!dry_run && remote && ret == 0) {
                for (ref = remote_refs; ref; ref = ref->next)
-                       update_tracking_ref(remote, ref);
+                       if (!is_null_sha1(ref->new_sha1))
+                               update_tracking_ref(remote, ref);
        }
 
        if (!new_refs && ret == 0)