summaryrefslogtreecommitdiff
path: root/midx.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-04-25 09:45:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-05-07 04:04:47 (GMT)
commitc9c935f6d4519c53f27f50113bea2c17deb8b71e (patch)
tree0d7f19b38ae3cbef07e7df681880ef41139bb5c9 /midx.c
parent46e91b663badd99b3807ab34decfd32f3cbf15e7 (diff)
downloadgit-c9c935f6d4519c53f27f50113bea2c17deb8b71e.zip
git-c9c935f6d4519c53f27f50113bea2c17deb8b71e.tar.gz
git-c9c935f6d4519c53f27f50113bea2c17deb8b71e.tar.bz2
restore: take tree-ish from --source option instead
This is another departure from 'git checkout' syntax, which uses -- to separate ref and pathspec. The observation is restore (or "git checkout -- <pathspec>") is most often used to restore some files from the index. If this is correct, we can simplify it by taking away the ref, so that we can write git restore some-file without worrying about some-file being a ref and whether we need to do git restore -- some-file for safety. If the source of the restore comes from a tree, it will be in the form of an option with value, e.g. git restore --source=this-tree some-file This is of course longer to type than using "--". But hopefully it will not be used as often, and it is clearly easier to understand. dwim_new_local_branch is no longer set (or unset) in cmd_restore_files() because it's irrelevant because we don't really care about dwim-ing. With accept_ref being unset, dwim can't happen. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.c')
0 files changed, 0 insertions, 0 deletions