git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unexpected behavior with the rev-parse operation
@ 2024-04-15 13:58 Toru Okugawa
  2024-04-28 18:08 ` Eric Sunshine
  0 siblings, 1 reply; 6+ messages in thread
From: Toru Okugawa @ 2024-04-15 13:58 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-01  4:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-15 13:58 Unexpected behavior with the rev-parse operation Toru Okugawa
2024-04-28 18:08 ` 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

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 NNTP newsgroup(s).