]> git.ipfire.org Git - thirdparty/git.git/commitdiff
chdir-notify: drop unused `chdir_notify_reparent()`
authorPatrick Steinhardt <ps@pks.im>
Thu, 25 Jun 2026 09:20:03 +0000 (11:20 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Jun 2026 20:19:57 +0000 (13:19 -0700)
With the preceding commit we've removed all callers of
`chdir_notify_reparent()`, so the function is unused now. Drop it.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
chdir-notify.c
chdir-notify.h

index f8bfe3cbef9aba4ec66d14c60a363fc58aff0874..1237a45e2e649240ed44110db64a0b04d27ac3f8 100644 (file)
@@ -43,32 +43,6 @@ void chdir_notify_unregister(const char *name, chdir_notify_callback cb,
        }
 }
 
-static void reparent_cb(const char *name,
-                       const char *old_cwd,
-                       const char *new_cwd,
-                       void *data)
-{
-       char **path = data;
-       char *tmp = *path;
-
-       if (!tmp)
-               return;
-
-       *path = reparent_relative_path(old_cwd, new_cwd, tmp);
-       free(tmp);
-
-       if (name) {
-               trace_printf_key(&trace_setup_key,
-                                "setup: reparent %s to '%s'",
-                                name, *path);
-       }
-}
-
-void chdir_notify_reparent(const char *name, char **path)
-{
-       chdir_notify_register(name, reparent_cb, path);
-}
-
 int chdir_notify(const char *new_cwd)
 {
        struct strbuf old_cwd = STRBUF_INIT;
index 81eb69d846e45d18b23484c98c292ed5d996552f..36b4114472e31d36979cfef32d2dbc991402c3c8 100644 (file)
  *   chdir_notify_register("description", foo, data);
  *
  * In practice most callers will want to move a relative path to the new root;
- * they can use the reparent_relative_path() helper for that. If that's all
- * you're doing, you can also use the convenience function:
- *
- *   chdir_notify_reparent("description", &my_path);
+ * they can use the reparent_relative_path() helper for that.
  *
  * Whenever a chdir event occurs, that will update my_path (if it's relative)
  * to adjust for the new cwd by freeing any existing string and allocating a
@@ -43,7 +40,6 @@ typedef void (*chdir_notify_callback)(const char *name,
 void chdir_notify_register(const char *name, chdir_notify_callback cb, void *data);
 void chdir_notify_unregister(const char *name, chdir_notify_callback cb,
                             void *data);
-void chdir_notify_reparent(const char *name, char **path);
 
 /*
  *