Code

git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.
[git.git] / builtin-send-pack.c
index 930e0fb3fdfee2293d0fca650d7139f09f2d381e..a708d0af48e210fd4439c336c2faa3e7400b5fa4 100644 (file)
@@ -226,8 +226,7 @@ static void update_tracking_ref(struct remote *remote, struct ref *ref)
                if (args.verbose)
                        fprintf(stderr, "updating local tracking ref '%s'\n", rs.dst);
                if (ref->deletion) {
-                       if (delete_ref(rs.dst, NULL))
-                               error("Failed to delete");
+                       delete_ref(rs.dst, NULL);
                } else
                        update_ref("update by push", rs.dst,
                                        ref->new_sha1, NULL, 0, 0);
@@ -537,9 +536,17 @@ static void verify_remote_names(int nr_heads, const char **heads)
        int i;
 
        for (i = 0; i < nr_heads; i++) {
-               const char *remote = strchr(heads[i], ':');
+               const char *local = heads[i];
+               const char *remote = strrchr(heads[i], ':');
 
-               remote = remote ? (remote + 1) : heads[i];
+               if (*local == '+')
+                       local++;
+
+               /* A matching refspec is okay.  */
+               if (remote == local && remote[1] == '\0')
+                       continue;
+
+               remote = remote ? (remote + 1) : local;
                switch (check_ref_format(remote)) {
                case 0: /* ok */
                case CHECK_REF_FORMAT_ONELEVEL: