diff options
author | 2017-05-28 17:01:10 +0000 | |
---|---|---|
committer | 2017-05-28 17:01:10 +0000 | |
commit | 59eae9b8a025d914568d4cf2e0329547792823dd (patch) | |
tree | 45dad15b310177d55cbbe773f244630c91039e91 /usr.bin/cvs/commit.c | |
parent | Teach opencvs status to display the sticky tag according to what it really (diff) | |
download | wireguard-openbsd-59eae9b8a025d914568d4cf2e0329547792823dd.tar.xz wireguard-openbsd-59eae9b8a025d914568d4cf2e0329547792823dd.zip |
Don't allow opencvs to commit towards tags that are not branches.
Gets rid of the old logic that wasn't working and replaced it with
a simplified version.
ok stsp@
Diffstat (limited to 'usr.bin/cvs/commit.c')
-rw-r--r-- | usr.bin/cvs/commit.c | 50 |
1 files changed, 7 insertions, 43 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index fa4102a8c37..8d9cbf6ae02 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.155 2016/10/13 20:51:25 fcambus Exp $ */ +/* $OpenBSD: commit.c,v 1.156 2017/05/28 17:01:10 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -363,52 +363,16 @@ cvs_commit_check_files(struct cvs_file *cf) if (tag != NULL && cf->file_rcs != NULL) { brev = rcs_sym_getrev(cf->file_rcs, tag); if (brev != NULL) { - if (RCSNUM_ISBRANCH(brev)) - goto next; - free(brev); - } - - brev = rcs_translate_tag(tag, cf->file_rcs); - - if (brev == NULL) { - if (cf->file_status == FILE_ADDED) - goto next; - fatal("failed to resolve tag: %s", - cf->file_ent->ce_tag); - } - - if ((branch = rcsnum_revtobr(brev)) == NULL) { - cvs_log(LP_ERR, "sticky tag %s is not " - "a branch for file %s", tag, - cf->file_path); - conflicts_found++; - free(brev); - return; - } - - if (!RCSNUM_ISBRANCHREV(brev)) { - cvs_log(LP_ERR, "sticky tag %s is not " - "a branch for file %s", tag, - cf->file_path); - conflicts_found++; - free(branch); - free(brev); - return; - } - - if (!RCSNUM_ISBRANCH(branch)) { - cvs_log(LP_ERR, "sticky tag %s is not " - "a branch for file %s", tag, - cf->file_path); - conflicts_found++; - free(branch); - free(brev); - return; + if (!RCSNUM_ISBRANCH(brev)) { + cvs_log(LP_ERR, "sticky tag %s is not " + "a branch for file %s", tag, + cf->file_path); + conflicts_found++; + } } } } -next: free(branch); free(brev); |