X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=send-pack.c;h=f74e66a8babd427ecd715c901d3d1680f1c5f13a;hb=89df580d0a2e97b0c7c072d87e5e815534deed56;hp=2c0b19ba34d8103c0db09ed8fa2f556636c7fcaa;hpb=b516968ff62ec153e008d033c153affd7ba9ddc6;p=git.git diff --git a/send-pack.c b/send-pack.c index 2c0b19ba3..f74e66a8b 100644 --- a/send-pack.c +++ b/send-pack.c @@ -305,22 +305,16 @@ static int send_pack(int in, int out, struct remote *remote, int nr_refspec, cha if (remote) { struct refspec rs; rs.src = ref->name; - remote_find_tracking(remote, &rs); - if (rs.dst) { - struct ref_lock *lock; + rs.dst = NULL; + if (!remote_find_tracking(remote, &rs)) { fprintf(stderr, " Also local %s\n", rs.dst); if (will_delete_ref) { if (delete_ref(rs.dst, NULL)) { error("Failed to delete"); } - } else { - lock = lock_any_ref_for_update(rs.dst, NULL, 0); - if (!lock) - error("Failed to lock"); - else - write_ref_sha1(lock, ref->new_sha1, - "update by push"); - } + } else + update_ref("update by push", rs.dst, + ref->new_sha1, NULL, 0, 0); free(rs.dst); } } @@ -354,6 +348,7 @@ static void verify_remote_names(int nr_heads, char **heads) case -2: /* ok but a single level -- that is fine for * a match pattern. */ + case -3: /* ok but ends with a pattern-match character */ continue; } die("remote part of refspec is not a valid name in %s",