aboutsummaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorCarlos Rica <jasampler@gmail.com>2007-09-11 05:19:34 +0200
committerJunio C Hamano <gitster@pobox.com>2007-09-12 13:25:07 -0700
commit0e5a7faa3a903cf7a0a66c81e20a76b91f17faab (patch)
treecd7e0dbe62f45ee0fb570710337ae181ddae03c0 /git.c
parent6640f88165f77edcc266a2c0c56fb017dc613198 (diff)
downloadgit-0e5a7faa3a903cf7a0a66c81e20a76b91f17faab.tar.gz
git-0e5a7faa3a903cf7a0a66c81e20a76b91f17faab.tar.xz
Make "git reset" a builtin.
This replaces the script "git-reset.sh" with "builtin-reset.c". A few git commands used in the script are called from the builtin also: "ls-files" to check for unmerged files, "read-tree" for resetting the index file in "mixed" and "hard" resets, and "update-index" to refresh at the end in the "mixed" reset and also for the option that gets selected paths into the index. The reset option with paths was implemented by Johannes Schindelin. Since the option that gets selected paths into the index is not a "reset" like the others because it does not change the HEAD at all, now the command is showing a warning when the "--mixed" option is supplied for that purpose. The following table shows the behaviour of "git reset" for the different supported options, where X means "changing" the HEAD, index or working tree: reset: --soft --mixed --hard -- <paths> HEAD X X X - index - X X X files - - X - Signed-off-by: Carlos Rica <jasampler@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r--git.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/git.c b/git.c
index fd3d83cd4..56ae8cccc 100644
--- a/git.c
+++ b/git.c
@@ -364,6 +364,7 @@ static void handle_internal_command(int argc, const char **argv)
{ "reflog", cmd_reflog, RUN_SETUP },
{ "repo-config", cmd_config },
{ "rerere", cmd_rerere, RUN_SETUP },
+ { "reset", cmd_reset, RUN_SETUP },
{ "rev-list", cmd_rev_list, RUN_SETUP },
{ "rev-parse", cmd_rev_parse, RUN_SETUP },
{ "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },