fsck: Not an error to have 1-linked objects, also print HEAD
This commit is contained in:
parent
b3c556a349
commit
3a9e2b36b0
|
|
@ -46,7 +46,6 @@ object_iter_callback (HacktreeRepo *repo,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
HtFsckData *data = user_data;
|
HtFsckData *data = user_data;
|
||||||
guint32 nlinks;
|
|
||||||
struct stat stbuf;
|
struct stat stbuf;
|
||||||
GChecksum *checksum = NULL;
|
GChecksum *checksum = NULL;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
@ -57,10 +56,9 @@ object_iter_callback (HacktreeRepo *repo,
|
||||||
dirname = g_path_get_dirname (path);
|
dirname = g_path_get_dirname (path);
|
||||||
checksum_prefix = g_path_get_basename (dirname);
|
checksum_prefix = g_path_get_basename (dirname);
|
||||||
|
|
||||||
nlinks = g_file_info_get_attribute_uint32 (file_info, "unix::nlink");
|
/* nlinks = g_file_info_get_attribute_uint32 (file_info, "unix::nlink");
|
||||||
|
|
||||||
if (nlinks < 2 && !quiet)
|
if (nlinks < 2 && !quiet)
|
||||||
g_printerr ("note: floating object: %s\n", path);
|
g_printerr ("note: floating object: %s\n", path); */
|
||||||
|
|
||||||
if (!hacktree_stat_and_checksum_file (-1, path, &checksum, &stbuf, &error))
|
if (!hacktree_stat_and_checksum_file (-1, path, &checksum, &stbuf, &error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
@ -94,6 +92,7 @@ hacktree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error
|
||||||
HtFsckData data;
|
HtFsckData data;
|
||||||
gboolean ret = FALSE;
|
gboolean ret = FALSE;
|
||||||
HacktreeRepo *repo = NULL;
|
HacktreeRepo *repo = NULL;
|
||||||
|
const char *head;
|
||||||
|
|
||||||
context = g_option_context_new ("- Check the repository for consistency");
|
context = g_option_context_new ("- Check the repository for consistency");
|
||||||
g_option_context_add_main_entries (context, options, NULL);
|
g_option_context_add_main_entries (context, options, NULL);
|
||||||
|
|
@ -113,6 +112,13 @@ hacktree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error
|
||||||
if (!hacktree_repo_iter_objects (repo, object_iter_callback, &data, error))
|
if (!hacktree_repo_iter_objects (repo, object_iter_callback, &data, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
head = hacktree_repo_get_head (repo);
|
||||||
|
if (!head)
|
||||||
|
{
|
||||||
|
if (!quiet)
|
||||||
|
g_printerr ("No HEAD file\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (!quiet)
|
if (!quiet)
|
||||||
g_printerr ("Total Objects: %u\n", data.n_objects);
|
g_printerr ("Total Objects: %u\n", data.n_objects);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue