; Re-apply accidentally reverted commit

This re-applies:

  2024-03-17 "Fix vc-dir when "remote" Git branch is local"
  (21828f28)

reverted as part of the unrelated:

  2024-03-17 "Update modus-themes to their 4.4.0 version"
  (67b0c1c0)

The original commit message follows:

Fix vc-dir when "remote" Git branch is local

While in there, add that "tracking" branch to the vc-dir
buffer.  For bug#68183.

* lisp/vc/vc-git.el (vc-git-dir-extra-headers): Reduce
boilerplate with new function 'vc-git--out-ok'; stop calling
vc-git-repository-url when REMOTE is "." to avoid throwing an
error; display tracking branch; prefer "none (<details...>)" to
"not (<details...>)" since that reads more grammatically
correct.
(vc-git--out-ok): Add documentation.
(vc-git--out-str): New function to easily get the output from a
Git command.
* test/lisp/vc/vc-git-tests.el (vc-git-test--with-repo)
(vc-git-test--run): New helpers, defined to steer clear of
vc-git-- internal functions.
(vc-git-test-dir-track-local-branch): Check that vc-dir does
not crash.
10 jobs for master in 167 minutes and 20 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Build Images
passed #82703
build-image-inotify

01:09:05

 
  Normal
failed #82704
test-all-inotify

00:36:46

 
  Platform Images
failed #82705
build-image-eglot

00:42:19

failed #82707
build-image-gnustep

00:00:17

passed #82706
build-image-tree-sitter

01:18:18

 
  Platforms
skipped #82708
test-eglot
skipped #82710
test-gnustep
passed #82709
test-tree-sitter

00:01:38

 
  Native Comp Images
passed #82711
build-native-comp-speed2

01:39:53

 
  Native Comp
failed #82712
test-native-comp-speed2

01:07:20

 
Name Stage Failure
failed
test-native-comp-speed2 Native Comp
Uploading artifacts for failed job
Uploading artifacts...
test-native-comp-speed2-8d4a8b7d/: found 544 matching artifact files and directories

Uploading artifacts as "archive" to coordinator... 201 Created
id=82712 responseStatus=201 Created token=4Vs_4Cca
Uploading artifacts...
test-native-comp-speed2-8d4a8b7d/junit-test-report.xml: found 1 matching artifact files and directories

Uploading artifacts as "junit" to coordinator... 201 Created
id=82712 responseStatus=201 Created token=4Vs_4Cca
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 2

failed
test-all-inotify Normal
Uploading artifacts for failed job
Uploading artifacts...
test-all-inotify-8d4a8b7d/: found 544 matching files and directories

Uploading artifacts as "archive" to coordinator... 201 Created
id=82704 responseStatus=201 Created token=xsFoNU6t
Uploading artifacts...
test-all-inotify-8d4a8b7d/junit-test-report.xml: found 1 matching files and directories

Uploading artifacts as "junit" to coordinator... 201 Created
id=82704 responseStatus=201 Created token=xsFoNU6t
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 2

failed
build-image-eglot Platform Images
context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Running after_script
Running after script...
$ test -n "$(docker ps -aq -f name=${test_name})" && docker cp ${test_name}:checkout/test ${test_name}
$ test -n "$(docker ps -aq -f name=${test_name})" && docker rm ${test_name}
$ find ${test_name} ! \( -name "*.log" -o -name ${EMACS_TEST_JUNIT_REPORT} \) -type f -delete
find: build-image-eglot-8d4a8b7d: No such file or directory
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

failed
build-image-gnustep Platform Images
Running with gitlab-runner 15.5.0 (0d4137b8)
on emba-dedicated-docker-runner or_peUvb

Preparing the "docker" executor
Using Docker executor with image docker:19.03.12 ...
Pulling docker image docker:19.03.12 ...

WARNING: Failed to pull image with policy "always": Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: TLS handshake timeout (manager.go:237:10s)
ERROR: Job failed: failed to pull image "docker:19.03.12" with specified policies [always]: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: TLS handshake timeout (manager.go:237:10s)