send-email: simplify Gmail example in the documentation
[gitweb.git] / builtin / checkout.c
index efcbd8f6b5e0b7d551c88c02b6d7d3069a47944d..3398c61e9a64ab686bf59fb027277f3de578b5fb 100644 (file)
@@ -242,7 +242,6 @@ static int checkout_paths(const struct checkout_opts *opts,
        struct checkout state;
        static char *ps_matched;
        unsigned char rev[20];
-       int flag;
        struct commit *head;
        int errs = 0;
        struct lock_file *lock_file;
@@ -375,7 +374,7 @@ static int checkout_paths(const struct checkout_opts *opts,
        if (write_locked_index(&the_index, lock_file, COMMIT_LOCK))
                die(_("unable to write new index file"));
 
-       read_ref_full("HEAD", 0, rev, &flag);
+       read_ref_full("HEAD", 0, rev, NULL);
        head = lookup_commit_reference_gently(rev, 1);
 
        errs |= post_checkout_hook(head, head, 0);
@@ -1111,7 +1110,7 @@ static int checkout_branch(struct checkout_opts *opts,
                char *head_ref = resolve_refdup("HEAD", 0, sha1, &flag);
                if (head_ref &&
                    (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path)))
-                       die_if_checked_out(new->path);
+                       die_if_checked_out(new->path, 1);
                free(head_ref);
        }