diff options
author | Chris Rorvick <chris@rorvick.com> | 2012-11-29 19:41:34 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-12-02 01:39:50 -0800 |
commit | b24e6047a8da3cddfd686e6a9157ed4bac28ed4f (patch) | |
tree | 6cb17f7ea002a44c823a5c034f5cb856249afe81 /remote.c | |
parent | 10643d4ec3b9c5898d93d1c20e98b2ff1906bf79 (diff) | |
download | git-b24e6047a8da3cddfd686e6a9157ed4bac28ed4f.tar.gz |
push: add advice for rejected tag reference
Advising the user to fetch and merge only makes sense if the rejected
reference is a branch. If none of the rejections are for branches, just
tell the user the reference already exists.
Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1279,6 +1279,14 @@ int match_push_refs(struct ref *src, struct ref **dst, return 0; } +static inline int is_forwardable(struct ref* ref) +{ + if (!prefixcmp(ref->name, "refs/tags/")) + return 0; + + return 1; +} + void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, int force_update) { @@ -1316,6 +1324,8 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror, * always allowed. */ + ref->not_forwardable = !is_forwardable(ref); + ref->nonfastforward = !ref->deletion && !is_null_sha1(ref->old_sha1) && |