From: Toru Okugawa <castor.4bit@gmail.com>
To: git@vger.kernel.org
Subject: Unexpected behavior with the rev-parse operation
Date: Mon, 15 Apr 2024 22:58:09 +0900 [thread overview]
Message-ID: <CANHPH1-6mbWdt_FLsrDEB_XVb4r3yTYMLLPUyDrL6tmS7jZgqQ@mail.gmail.com> (raw)
Hi,
I have encountered some unexpected behavior with the rev-parse operation.
---
What did you do before the bug happened? (Steps to reproduce your issue)
```
$ mkdir -p /tmp/example
$ cd $_
$ ls -a
. ..
$ git rev-parse --is-inside-work-tree
fatal: not a git repository (or any of the parent directories): .git
```
What did you expect to happen? (Expected behavior)
If the current working directory is outside the work tree, the
documentation says that `git rev-parse --is-inside-work-tree` will
output false.
https://git-scm.com/docs/git-rev-parse#Documentation/git-rev-parse.txt---is-inside-work-tree
```
$ git rev-parse --is-inside-work-tree
false
```
What happened instead? (Actual behavior)
It will output `fatal: not a git repository (or any of the parent
directories): .git` and exit with code 128. The `--is-inside-git-dir`
option works the same way.
```
$ git rev-parse --is-inside-work-tree
fatal: not a git repository (or any of the parent directories): .git
```
[System Info]
git version:
git version 2.44.0
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 22.6.0 Darwin Kernel Version 22.6.0: Wed Jul 5 22:21:53
PDT 2023; root:xnu-8796.141.3~6/RELEASE_ARM64_T6020 arm64
compiler info: clang: 15.0.0 (clang-1500.1.0.2.5)
libc info: no libc information available
$SHELL (typically, interactive shell): /opt/homebrew/bin/zsh
Thanks
next reply other threads:[~2024-04-15 13:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-15 13:58 Toru Okugawa [this message]
2024-04-28 18:08 ` Unexpected behavior with the rev-parse operation Eric Sunshine
2024-04-28 23:07 ` Re* " Junio C Hamano
2024-04-30 14:26 ` Toru Okugawa
2024-04-30 18:46 ` Junio C Hamano
2024-05-01 4:55 ` Toru Okugawa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CANHPH1-6mbWdt_FLsrDEB_XVb4r3yTYMLLPUyDrL6tmS7jZgqQ@mail.gmail.com \
--to=castor.4bit@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).