{"thread":{"id":"64554","subject":"`--max-depth` produces no output when <path> is '.' or ends with slash","startedAt":"2025-11-29T22:45:52Z","lastAt":"2025-11-29T22:45:52Z","messageCount":1,"participants":["Han Jiang"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"531453","messageId":"CANrWfmTjexptaqxD7b5zAh=gueQh_PC-YXdFmrJ+VLRUi-a_VA@mail.gmail.com","threadId":"64554","inReplyTo":null,"subject":"`--max-depth` produces no output when <path> is '.' or ends with slash","fromName":"Han Jiang","fromEmail":"jhcarl0814@gmail.com","sentAt":"2025-11-29T22:45:40Z","receivedAt":"2025-11-29T22:45:52Z","isPatch":false,"sender":{"key":"jhcarl0814@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5171262?v=4"},"body":"What did you do before the bug happened? (Steps to reproduce your issue)\n\nmkdir --parents -- './repo/1/2/3/4/5/6'\ncd './repo'\ngit init '.'\necho '1' >'./1/2/3/4/5/6/7'; git add './1/2/3/4/5/6/7'; git commit\n--message=\"$((++number))\"\necho '2' >'./1/2/3/4/5/6/7'; git add './1/2/3/4/5/6/7'; git commit\n--message=\"$((++number))\"\n\ngit diff 'HEAD~1' HEAD -- '.'\ngit diff --max-depth=6 'HEAD~1' HEAD -- '.'\ngit diff --max-depth=7 'HEAD~1' HEAD -- '.' # wrong, should produce some output\ngit diff --max-depth=100 'HEAD~1' HEAD -- '.' # wrong, should produce\nsome output\ngit diff --max-depth=-1 'HEAD~1' HEAD -- '.'\n\ngit diff 'HEAD~1' HEAD -- './'\ngit diff --max-depth=6 'HEAD~1' HEAD -- './'\ngit diff --max-depth=7 'HEAD~1' HEAD -- './' # wrong, should produce some output\ngit diff --max-depth=100 'HEAD~1' HEAD -- './' # wrong, should produce\nsome output\ngit diff --max-depth=-1 'HEAD~1' HEAD -- './'\n\ngit diff 'HEAD~1' HEAD -- './1'\ngit diff --max-depth=5 'HEAD~1' HEAD -- './1'\ngit diff --max-depth=6 'HEAD~1' HEAD -- './1'\n\ngit diff 'HEAD~1' HEAD -- './1/'\ngit diff --max-depth=5 'HEAD~1' HEAD -- './1/'\ngit diff --max-depth=6 'HEAD~1' HEAD -- './1/' # wrong, should produce\nsome output\ngit diff --max-depth=100 'HEAD~1' HEAD -- './1/' # wrong, should\nproduce some output\ngit diff --max-depth=-1 'HEAD~1' HEAD -- './1/'\n\ngit diff 'HEAD~1' HEAD -- './1/2'\ngit diff --max-depth=4 'HEAD~1' HEAD -- './1/2'\ngit diff --max-depth=5 'HEAD~1' HEAD -- './1/2'\n\ngit diff 'HEAD~1' HEAD -- './1/2/'\ngit diff --max-depth=4 'HEAD~1' HEAD -- './1/2/'\ngit diff --max-depth=5 'HEAD~1' HEAD -- './1/2/' # wrong, should\nproduce some output\ngit diff --max-depth=100 'HEAD~1' HEAD -- './1/2/' # wrong, should\nproduce some output\ngit diff --max-depth=-1 'HEAD~1' HEAD -- './1/2/'\n\n\nWhat did you expect to happen? (Expected behavior)\n\nUsing `--max-depth=nonnegative_number` with '.' and\n'./path_ending_in_slash/' should produce same output as with\n'./path_not_ending_in_slash' instead of producing no output.\n\n\nWhat happened instead? (Actual behavior)\n\nWhat's different between what you expected and what actually happened?\n\nAnything else you want to add:\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n\n[System Info]\ngit version:\ngit version 2.52.0.windows.1\ncpu: x86_64\nbuilt from commit: 2912d8e9b8253723974b7baf1c890273b1a1c5bd\nsizeof-long: 4\nsizeof-size_t: 8\nshell-path: D:/git-sdk-64-build-installers/usr/bin/sh\nrust: disabled\nfeature: fsmonitor--daemon\nlibcurl: 8.17.0\nOpenSSL: OpenSSL 3.5.4 30 Sep 2025\nzlib: 1.3.1\nSHA-1: SHA1_DC\nSHA-256: SHA256_BLK\ndefault-ref-format: files\ndefault-hash: sha1\nuname: Windows 10.0 26200\ncompiler info: gnuc: 15.2\nlibc info: no libc information available\n$SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n\n\n[Enabled Hooks]\nnot run from a git repository - no hooks to show\n"}]}