Unexpected behavior with the rev-parse operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux