[ostree] static-delta: do not accept both --from=REV and --empty for generate
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] static-delta: do not accept both --from=REV and --empty for generate
- Date: Fri, 16 Jan 2015 03:55:10 +0000 (UTC)
commit f2ae405f9f9658cb2252b4cbcc12f222530bcc92
Author: Giuseppe Scrivano <gscrivan redhat com>
Date: Wed Jan 14 16:53:21 2015 +0100
static-delta: do not accept both --from=REV and --empty for generate
Signed-off-by: Giuseppe Scrivano <gscrivan redhat com>
src/ostree/ot-builtin-static-delta.c | 6 ++++++
tests/test-delta.sh | 4 ++++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/ostree/ot-builtin-static-delta.c b/src/ostree/ot-builtin-static-delta.c
index 45ba6b6..b49b918 100644
--- a/src/ostree/ot-builtin-static-delta.c
+++ b/src/ostree/ot-builtin-static-delta.c
@@ -157,6 +157,12 @@ ot_static_delta_builtin_generate (int argc, char **argv, GCancellable *cancellab
if (opt_empty)
{
+ if (opt_from_rev)
+ {
+ g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
+ "Cannot specify both --empty and --from=REV");
+ goto out;
+ }
from_source = NULL;
}
else if (opt_from_rev == NULL)
diff --git a/tests/test-delta.sh b/tests/test-delta.sh
index c598186..6420b21 100755
--- a/tests/test-delta.sh
+++ b/tests/test-delta.sh
@@ -68,6 +68,10 @@ ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev}
ostree --repo=repo static-delta list | grep ${origrev}-${newrev} || exit 1
+if ${CMD_PREFIX} ostree --repo=repo static-delta generate --from=${origrev} --to=${newrev} --empty
2>>err.txt; then
+ assert_not_reached "static-delta generate --from=${origrev} --empty unexpectedly succeeded"
+fi
+
origstart=$(echo ${origrev} | dd bs=1 count=2 2>/dev/null)
origend=$(echo ${origrev} | dd bs=1 skip=2 2>/dev/null)
assert_has_dir repo/deltas/${origstart}/${origend}-${newrev}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]