diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-05-29 12:34:45 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-29 12:34:45 +0900 |
commit | f55734fd8c7209855d50c0acb45e7228899e41f7 (patch) | |
tree | 47f36515b7ee83b8d515113fff29c98c2d01d296 /builtin/read-tree.c | |
parent | Merge branch 'js/plug-leaks' (diff) | |
parent | read-tree: "read-tree -m --empty" does not make sense (diff) | |
download | tgif-f55734fd8c7209855d50c0acb45e7228899e41f7.tar.xz |
Merge branch 'jc/read-tree-empty-with-m'
"git read-tree -m" (no tree-ish) gave a nonsense suggestion "use
--empty if you want to clear the index". With "-m", such a request
will still fail anyway, as you'd need to name at least one tree-ish
to be merged.
* jc/read-tree-empty-with-m:
read-tree: "read-tree -m --empty" does not make sense
Diffstat (limited to 'builtin/read-tree.c')
-rw-r--r-- | builtin/read-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/read-tree.c b/builtin/read-tree.c index 6d45175f6a..daf8d7795d 100644 --- a/builtin/read-tree.c +++ b/builtin/read-tree.c @@ -210,7 +210,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix) die("failed to unpack tree object %s", arg); stage++; } - if (nr_trees == 0 && !read_empty) + if (!nr_trees && !read_empty && !opts.merge) warning("read-tree: emptying the index with no arguments is deprecated; use --empty"); else if (nr_trees > 0 && read_empty) die("passing trees as arguments contradicts --empty"); |