reset $pathspec: exit with code 0 if successful
[gitweb.git] / builtin / reset.c
index 8cc7c722ef1c4912aac18d5dddb6aaf31a755ce2..65413d0a67041474625ea55a1912c178314b365c 100644 (file)
@@ -119,19 +119,17 @@ static void print_new_head_line(struct commit *commit)
 
 static int update_index_refresh(int fd, struct lock_file *index_lock, int flags)
 {
-       int result;
-
        if (!index_lock) {
                index_lock = xcalloc(1, sizeof(struct lock_file));
                fd = hold_locked_index(index_lock, 1);
        }
 
-       result = refresh_index(&the_index, (flags), NULL, NULL,
-                              _("Unstaged changes after reset:")) ? 1 : 0;
+       refresh_index(&the_index, (flags), NULL, NULL,
+                     _("Unstaged changes after reset:"));
        if (write_cache(fd, active_cache, active_nr) ||
                        commit_locked_index(index_lock))
                return error ("Could not refresh index");
-       return result;
+       return 0;
 }
 
 static void update_index_from_diff(struct diff_queue_struct *q,