aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/stash.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/stash.c')
-rw-r--r--builtin/stash.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/stash.c b/builtin/stash.c
index c212b1c0b2..dbaa999cf1 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,4 +1,5 @@
#define USE_THE_REPOSITORY_VARIABLE
+
#include "builtin.h"
#include "abspath.h"
#include "config.h"
@@ -873,9 +874,8 @@ static void diff_include_untracked(const struct stash_info *info, struct diff_op
struct tree *tree[ARRAY_SIZE(oid)];
struct tree_desc tree_desc[ARRAY_SIZE(oid)];
struct unpack_trees_options unpack_tree_opt = { 0 };
- int i;
- for (i = 0; i < ARRAY_SIZE(oid); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(oid); i++) {
tree[i] = parse_tree_indirect(oid[i]);
if (parse_tree(tree[i]) < 0)
die(_("failed to parse tree"));
@@ -1557,12 +1557,11 @@ static int do_push_stash(const struct pathspec *ps, const char *stash_msg, int q
repo_read_index_preload(the_repository, NULL, 0);
if (!include_untracked && ps->nr) {
- int i;
char *ps_matched = xcalloc(ps->nr, 1);
/* TODO: audit for interaction with sparse-index. */
ensure_full_index(the_repository->index);
- for (i = 0; i < the_repository->index->cache_nr; i++)
+ for (size_t i = 0; i < the_repository->index->cache_nr; i++)
ce_path_match(the_repository->index, the_repository->index->cache[i], ps,
ps_matched);