diff --git a/arcanist/lib/WatchmanInstance.php b/arcanist/lib/WatchmanInstance.php index aaed150392e4..0d06f2e316aa 100644 --- a/arcanist/lib/WatchmanInstance.php +++ b/arcanist/lib/WatchmanInstance.php @@ -238,6 +238,14 @@ function start() { throw new Exception("Failed to talk to watchman on $sockname"); } stream_set_timeout($this->sock, self::TIMEOUT); + + // If you're debugging and want to attach a debugger, then: + // `WATCHMAN_DEBUG_WAIT=1 arc unit tests/integration/age.php` + // then gdb -p or lldb -p with the PID it prints out + if (getenv("WATCHMAN_DEBUG_WAIT")) { + printf("PID: %d\n", $this->getProcessID()); + sleep(10); + } } private function fwrite_all($sock, $buf) { diff --git a/root.c b/root.c index 4e8068d2cd52..dce41df1f69c 100644 --- a/root.c +++ b/root.c @@ -1416,6 +1416,17 @@ static void age_out_file(w_root_t *root, w_ht_t *aged_dir_names, // Remove the entry from the containing dir hash w_ht_del(file->parent->dirs, w_ht_ptr_val(full_name)); } + if (file->parent->lc_files) { + // Remove the entry from the containing lower case files hash, + // but only it it matches us (it may point to a different file + // node with a differently-cased name) + w_string_t *lc_name = w_string_dup_lower(file->name); + if (w_ht_get(file->parent->lc_files, w_ht_ptr_val(lc_name)) + == w_ht_ptr_val(file)) { + w_ht_del(file->parent->lc_files, w_ht_ptr_val(lc_name)); + } + w_string_delref(lc_name); + } // resolve the dir of the same name and mark it for later removal // from our internal datastructures