FreeBSD Bugzilla – Attachment 224009 Details for
Bug 254971
net/gitup: ignored paths aren't ignored
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Patch to make gitup ignore paths marked ignore.
patch-gitup.c (text/plain), 2.65 KB, created by
Peter Jeremy
on 2021-04-11 06:27:08 UTC
(
hide
)
Description:
Patch to make gitup ignore paths marked ignore.
Filename:
MIME Type:
Creator:
Peter Jeremy
Created:
2021-04-11 06:27:08 UTC
Size:
2.65 KB
patch
obsolete
>--- gitup.c.orig 2021-01-25 08:18:37.000000000 +1100 >+++ gitup.c 2021-04-11 16:01:27.237258000 +1000 >@@ -148,6 +148,7 @@ > static void unpack_objects(connector *); > static uint32_t unpack_variable_length_integer(char *, uint32_t *); > static void usage(const char *); >+static bool ignore_file(connector *, char *); > > /* > * node_compare >@@ -637,6 +638,10 @@ > err(EXIT_FAILURE, "find_local_tree: full_path malloc"); > > snprintf(full_path, full_path_size, "%s/%s", base_path, entry->d_name); >+ if (ignore_file(connection, full_path)) { >+ free(full_path); >+ continue; >+ } > > if (lstat(full_path, &file) == -1) > err(EXIT_FAILURE, "find_local_tree: %s", full_path); >@@ -679,6 +684,9 @@ > char *buffer = NULL; > uint32_t buffer_size = 0; > >+ if (ignore_file(connection, path)) >+ return; >+ > lookup_object.hash = hash; > lookup_file.hash = hash; > lookup_file.path = path; >@@ -1872,6 +1880,8 @@ > if ((mkdir(found_file->path, 0755) == -1) && (errno != EEXIST)) > err(EXIT_FAILURE, "save_repairs: cannot create %s", found_file->path); > } else { >+ if (ignore_file(connection, file->path)) >+ continue; > missing = stat(found_file->path, &check_file); > update = true; > >@@ -2155,7 +2165,7 @@ > char *command = NULL, *start = NULL, *temp = NULL, *extension = NULL, *want = NULL, section[BUFFER_UNIT_SMALL]; > char gitup_revision[BUFFER_UNIT_SMALL], gitup_revision_path[BUFFER_UNIT_SMALL]; > int x = 0, o = 0, option = 0, length = 0, skip_optind = 0; >- bool ignore = false, current_repository = false, encoded = false; >+ bool current_repository = false, encoded = false; > bool path_target_exists = false, remote_files_exists = false, pack_file_exists = false; > > connector connection = { >@@ -2429,11 +2439,7 @@ > > RB_FOREACH_SAFE(file, Tree_Local_Path, &Local_Path, next_file) { > if ((file->keep == false) && ((current_repository == false) || (connection.repair == true))) { >- for (x = 0, ignore = false; x < connection.ignores; x++) >- if (strnstr(file->path, connection.ignore[x], strlen(file->path)) != NULL) >- ignore = true; >- >- if (ignore == false) { >+ if (!ignore_file(&connection, file->path)) { > if (connection.verbosity) > printf(" - %s\n", file->path); > >@@ -2495,4 +2501,17 @@ > sync(); > > return (0); >+} >+ >+/* >+ * Return true if path is in the set of "ignores" for the connection >+ */ >+static bool ignore_file(connector *connection, char *path) >+{ >+ int x; >+ >+ for (x = 0; x < connection->ignores; x++) >+ if (strncmp(path, connection->ignore[x], strlen(connection->ignore[x])) == 0) >+ return (true); >+ return (false); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 254971
: 224009