summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2007-10-03 13:12:07 +0000
committerJoris Vink <joris@cvs.openbsd.org>2007-10-03 13:12:07 +0000
commit9a1570f6c7d3681a28da52776ea5c5b6fc5df41e (patch)
tree4fb1022dab3b78382d80e9832a32eab3cda65bfa
parent91e049d131acb98a8b3ff54ab8f882b27b354479 (diff)
reset the default branch early on so rcs_head_get() does not screw us up
and returns a possibly wrong revision as 'current revision'. noticed by tobias@ his regress testing
-rw-r--r--usr.bin/cvs/commit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.bin/cvs/commit.c b/usr.bin/cvs/commit.c
index 8ebb4e8f1c2..1a90b308ea3 100644
--- a/usr.bin/cvs/commit.c
+++ b/usr.bin/cvs/commit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: commit.c,v 1.113 2007/09/24 13:56:09 joris Exp $ */
+/* $OpenBSD: commit.c,v 1.114 2007/10/03 13:12:06 joris Exp $ */
/*
* Copyright (c) 2006 Joris Vink <joris@openbsd.org>
* Copyright (c) 2006 Xavier Santolaria <xsa@openbsd.org>
@@ -289,6 +289,11 @@ cvs_commit_local(struct cvs_file *cf)
crev = NULL;
rrev = NULL;
+ if (cf->file_rcs->rf_branch != NULL) {
+ rcsnum_free(cf->file_rcs->rf_branch);
+ cf->file_rcs->rf_branch = NULL;
+ }
+
if (cf->file_status == FILE_MODIFIED ||
cf->file_status == FILE_REMOVED || (cf->file_status == FILE_ADDED
&& cf->file_rcs != NULL && cf->file_rcs->rf_dead == 1)) {
@@ -418,11 +423,6 @@ cvs_commit_local(struct cvs_file *cf)
fatal("cvs_commit_local: failed to set state");
}
- if (cf->file_rcs->rf_branch != NULL) {
- rcsnum_free(cf->file_rcs->rf_branch);
- cf->file_rcs->rf_branch = NULL;
- }
-
if (cf->file_status == FILE_ADDED && cf->file_ent->ce_opts != NULL) {
int kflag;