summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builtin-fsck.c2
-rw-r--r--builtin-prune.c9
2 files changed, 5 insertions, 6 deletions
diff --git a/builtin-fsck.c b/builtin-fsck.c
index 6eb7da88d3..d3f3de9446 100644
--- a/builtin-fsck.c
+++ b/builtin-fsck.c
@@ -385,7 +385,7 @@ static void fsck_dir(int i, char *path)
add_sha1_list(sha1, DIRENT_SORT_HINT(de));
continue;
}
- if (prefixcmp(de->d_name, "tmp_obj_"))
+ if (!prefixcmp(de->d_name, "tmp_obj_"))
continue;
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
diff --git a/builtin-prune.c b/builtin-prune.c
index 947de8cf25..c767a0ac89 100644
--- a/builtin-prune.c
+++ b/builtin-prune.c
@@ -69,11 +69,6 @@ static int prune_dir(int i, char *path)
if (de->d_name[0] != '.')
break;
continue;
- case 14:
- if (prefixcmp(de->d_name, "tmp_obj_"))
- break;
- prune_tmp_object(path, de->d_name);
- continue;
case 38:
sprintf(name, "%02x", i);
memcpy(name+2, de->d_name, len+1);
@@ -90,6 +85,10 @@ static int prune_dir(int i, char *path)
prune_object(path, de->d_name, sha1);
continue;
}
+ if (!prefixcmp(de->d_name, "tmp_obj_")) {
+ prune_tmp_object(path, de->d_name);
+ continue;
+ }
fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name);
}
if (!show_only)