github / github/copilot-cli

Permission prompt incorrectly associates non-git directory with CLI session's git repo when adding safe directory

Aperta
#3,616 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
area:permissions
Lingua principale
Shell
Stelle
11.2k
Fork
1.9k
Merge medio
14h 16m
PR unite (30g)
6

Descrizione

### Describe the bug

Bug: When editing a file in a directory that is not under git (e.g., C:\temp\copilot), the permission prompt "Yes, and don't ask again for file operations in this repo" incorrectly references the CLI session's current git repository (C:\git\jdev\src) instead of the file's actual directory. The safe-directory association should be based on the file being edited, not the CLI's CWD.

Image

### Affected version

You're running **GitHub Copilot CLI 1.0.56**. Worth including in your bug report!

### Steps to reproduce the behavior

start copilot in a directory that is under git control. tell copilot to create a file in a directory that is not under git control. it will ask if it can edit the file and then ask if it should put the git-controlled directory in the directories list

### Expected behavior

I would expect it to ask if it can put the directory where I've asked it to edit the file in its safe directories list.

### Additional context

_No response_

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci il prompt avviando la CLI in una directory controllata da git e chiedendole di creare un file in una directory non correlata, come C:\temp\copilot. Traccia come la scelta di safe-directory viene associata al file modificato e conferma che il prompt indica la directory di quel file anziché il repository corrente della sessione CLI.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
git
Ambito
cli, security
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.