summaryrefslogtreecommitdiff
path: root/builtin/read-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-05-29 03:34:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-29 03:34:45 (GMT)
commitf55734fd8c7209855d50c0acb45e7228899e41f7 (patch)
tree47f36515b7ee83b8d515113fff29c98c2d01d296 /builtin/read-tree.c
parent849e671b52e11d4a2f70d577dd2c806f3ca756fe (diff)
parentb9b10d36816b8c7276bb83eb08fdbb59f68ef99b (diff)
downloadgit-f55734fd8c7209855d50c0acb45e7228899e41f7.zip
git-f55734fd8c7209855d50c0acb45e7228899e41f7.tar.gz
git-f55734fd8c7209855d50c0acb45e7228899e41f7.tar.bz2
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 6d45175..daf8d77 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");