summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index 04fd9ea4bd..51016831b9 100644
--- a/remote.c
+++ b/remote.c
@@ -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) &&