From 88e8e3a265dbbd0fbda00b6c546f53a6de1d9717 Mon Sep 17 00:00:00 2001 From: Andrew Ayer Date: Fri, 12 Sep 2014 19:42:59 -0700 Subject: [PATCH] Display error if both -k and -a options passed to `git-crypt lock` --- commands.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/commands.cpp b/commands.cpp index 4b593f6..3a6b0c1 100644 --- a/commands.cpp +++ b/commands.cpp @@ -870,6 +870,11 @@ int lock (int argc, const char** argv) return 2; } + if (all_keys && key_name) { + std::clog << "Error: -k and --all options are mutually exclusive" << std::endl; + return 2; + } + // 0. Make sure working directory is clean (ignoring untracked files) // We do this because we run 'git checkout -f HEAD' later and we don't // want the user to lose any changes. 'git checkout -f HEAD' doesn't touch