summaryrefslogtreecommitdiff
path: root/builtin/read-tree.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-05-29 12:34:45 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-05-29 12:34:45 +0900
commitf55734fd8c7209855d50c0acb45e7228899e41f7 (patch)
tree47f36515b7ee83b8d515113fff29c98c2d01d296 /builtin/read-tree.c
parentMerge branch 'js/plug-leaks' (diff)
parentread-tree: "read-tree -m --empty" does not make sense (diff)
downloadtgif-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.c2
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");