projects
/
platform
/
upstream
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.15.0
[platform/upstream/git.git]
/
builtin
/
prune.c
diff --git
a/builtin/prune.c
b/builtin/prune.c
index
8f4f052
..
cddabf2
100644
(file)
--- a/
builtin/prune.c
+++ b/
builtin/prune.c
@@
-13,7
+13,7
@@
static const char * const prune_usage[] = {
};
static int show_only;
static int verbose;
};
static int show_only;
static int verbose;
-static
unsigned long
expire;
+static
timestamp_t
expire;
static int show_progress = -1;
static int prune_tmp_file(const char *fullpath)
static int show_progress = -1;
static int prune_tmp_file(const char *fullpath)
@@
-30,7
+30,7
@@
static int prune_tmp_file(const char *fullpath)
return 0;
}
return 0;
}
-static int prune_object(const
unsigned char *sha1
, const char *fullpath,
+static int prune_object(const
struct object_id *oid
, const char *fullpath,
void *data)
{
struct stat st;
void *data)
{
struct stat st;
@@
-39,7
+39,7
@@
static int prune_object(const unsigned char *sha1, const char *fullpath,
* Do we know about this object?
* It must have been reachable
*/
* Do we know about this object?
* It must have been reachable
*/
- if (lookup_object(
sha1
))
+ if (lookup_object(
oid->hash
))
return 0;
if (lstat(fullpath, &st)) {
return 0;
if (lstat(fullpath, &st)) {
@@
-50,8
+50,8
@@
static int prune_object(const unsigned char *sha1, const char *fullpath,
if (st.st_mtime > expire)
return 0;
if (show_only || verbose) {
if (st.st_mtime > expire)
return 0;
if (show_only || verbose) {
- enum object_type type = sha1_object_info(
sha1
, NULL);
- printf("%s %s\n",
sha1_to_hex(sha1
),
+ enum object_type type = sha1_object_info(
oid->hash
, NULL);
+ printf("%s %s\n",
oid_to_hex(oid
),
(type > 0) ? typename(type) : "unknown");
}
if (!show_only)
(type > 0) ? typename(type) : "unknown");
}
if (!show_only)
@@
-68,7
+68,7
@@
static int prune_cruft(const char *basename, const char *path, void *data)
return 0;
}
return 0;
}
-static int prune_subdir(int nr, const char *path, void *data)
+static int prune_subdir(
unsigned
int nr, const char *path, void *data)
{
if (!show_only)
rmdir(path);
{
if (!show_only)
rmdir(path);
@@
-111,7
+111,7
@@
int cmd_prune(int argc, const char **argv, const char *prefix)
};
char *s;
};
char *s;
- expire =
ULONG
_MAX;
+ expire =
TIME
_MAX;
save_commit_buffer = 0;
check_replace_refs = 0;
ref_paranoia = 1;
save_commit_buffer = 0;
check_replace_refs = 0;
ref_paranoia = 1;
@@
-123,11
+123,12
@@
int cmd_prune(int argc, const char **argv, const char *prefix)
die(_("cannot prune in a precious-objects repo"));
while (argc--) {
die(_("cannot prune in a precious-objects repo"));
while (argc--) {
-
unsigned char sha1[20]
;
+
struct object_id oid
;
const char *name = *argv++;
const char *name = *argv++;
- if (!get_sha1(name, sha1)) {
- struct object *object = parse_object_or_die(sha1, name);
+ if (!get_oid(name, &oid)) {
+ struct object *object = parse_object_or_die(&oid,
+ name);
add_pending_object(&revs, object, "");
}
else
add_pending_object(&revs, object, "");
}
else
@@
-137,7
+138,7
@@
int cmd_prune(int argc, const char **argv, const char *prefix)
if (show_progress == -1)
show_progress = isatty(2);
if (show_progress)
if (show_progress == -1)
show_progress = isatty(2);
if (show_progress)
- progress = start_
progress_delay(_("Checking connectivity"), 0, 0, 2
);
+ progress = start_
delayed_progress(_("Checking connectivity"), 0
);
mark_reachable_objects(&revs, 1, expire, progress);
stop_progress(&progress);
mark_reachable_objects(&revs, 1, expire, progress);
stop_progress(&progress);