diff options
author | 2006-07-02 21:01:48 +0000 | |
---|---|---|
committer | 2006-07-02 21:01:48 +0000 | |
commit | 846e2b747370f11676a83ebedbc8f02cba4c618a (patch) | |
tree | 731fc8e69897b12a46f40a88da8e2101add70c1c | |
parent | no "servconf.h" needed here (diff) | |
download | wireguard-openbsd-846e2b747370f11676a83ebedbc8f02cba4c618a.tar.xz wireguard-openbsd-846e2b747370f11676a83ebedbc8f02cba4c618a.zip |
- abort the commit when files are not correctly up to date.
- do not try to attempt to check for conflict markers when the file is not on disk.
found by and okay reyk@
-rw-r--r-- | usr.bin/cvs/commit.c | 12 | ||||
-rw-r--r-- | usr.bin/cvs/update.c | 5 |
2 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c index 795d79a78bb..cf4c9fb8c90 100644 --- a/usr.bin/cvs/commit.c +++ b/usr.bin/cvs/commit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: commit.c,v 1.78 2006/06/29 00:41:52 joris Exp $ */ +/* $OpenBSD: commit.c,v 1.79 2006/07/02 21:01:48 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org> @@ -129,23 +129,27 @@ cvs_commit_check_conflicts(struct cvs_file *cf) } if (cf->file_status == FILE_CONFLICT || - cf->file_status == FILE_LOST || - cf->file_status == FILE_UNLINK) + cf->file_status == FILE_UNLINK) { conflicts_found++; + return; + } if (cf->file_status != FILE_REMOVED && update_has_conflict_markers(cf)) { cvs_log(LP_ERR, "conflict: unresolved conflicts in %s from " "merging, please fix these first", cf->file_path); conflicts_found++; + return; } if (cf->file_status == FILE_MERGE || cf->file_status == FILE_PATCH || - cf->file_status == FILE_CHECKOUT) { + cf->file_status == FILE_CHECKOUT || + cf->file_status == FILE_LOST) { cvs_log(LP_ERR, "conflict: %s is not up-to-date", cf->file_path); conflicts_found++; + return; } if (cf->file_status == FILE_ADDED || diff --git a/usr.bin/cvs/update.c b/usr.bin/cvs/update.c index dfbd8fd8526..448671dc856 100644 --- a/usr.bin/cvs/update.c +++ b/usr.bin/cvs/update.c @@ -1,4 +1,4 @@ -/* $OpenBSD: update.c,v 1.77 2006/07/01 21:09:36 reyk Exp $ */ +/* $OpenBSD: update.c,v 1.78 2006/07/02 21:01:48 joris Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -395,6 +395,9 @@ update_has_conflict_markers(struct cvs_file *cf) cvs_log(LP_TRACE, "update_has_conflict_markers(%s)", cf->file_path); + if (cf->fd == -1) + return (0); + if ((bp = cvs_buf_load_fd(cf->fd, BUF_AUTOEXT)) == NULL) fatal("update_has_conflict_markers: failed to load %s", cf->file_path); |