receive-pack: allow using --strict mode for unpacking objects
[gitweb.git] / builtin-reset.c
index 3bec06bc8ed5ca23b89e7cbc4e306903410cc7b6..bb3e19240a8921126600cddd70ac46b3b1bada29 100644 (file)
@@ -16,6 +16,7 @@
 #include "diff.h"
 #include "diffcore.h"
 #include "tree.h"
+#include "branch.h"
 
 static const char builtin_reset_usage[] =
 "git-reset [--mixed | --soft | --hard] [-q] [<commit-ish>] [ [--] <paths>...]";
@@ -62,14 +63,10 @@ static int reset_index_file(const unsigned char *sha1, int is_hard_reset)
 
 static void print_new_head_line(struct commit *commit)
 {
-       const char *hex, *dots = "...", *body;
+       const char *hex, *body;
 
        hex = find_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV);
-       if (!hex) {
-               hex = sha1_to_hex(commit->object.sha1);
-               dots = "";
-       }
-       printf("HEAD is now at %s%s", hex, dots);
+       printf("HEAD is now at %s", hex);
        body = strstr(commit->buffer, "\n\n");
        if (body) {
                const char *eol;
@@ -270,10 +267,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
                break;
        }
 
-       unlink(git_path("MERGE_HEAD"));
-       unlink(git_path("rr-cache/MERGE_RR"));
-       unlink(git_path("MERGE_MSG"));
-       unlink(git_path("SQUASH_MSG"));
+       remove_branch_state();
 
        free(reflog_action);