Fix git sync nag showing immediately after cloning external projects

Store the HEAD commit OID as 'shakespeare.clonedAt' git config at clone
time, then use it to determine whether the user has actually altered the
project before showing the backup warning.
This commit is contained in:
Alex Gleason committed 2026-03-18 01:24:10 -05:00
1 parent 459311bd7b
commit c5ed881af0
3 files changed
+47 -11

No files matched your search

+12
View File
@@ -524,6 +524,18 @@ export class ProjectsManager {
remote: fork ? 'upstream' : undefined, // Use 'upstream' for forks, otherwise defaults to 'origin'
});
// Store the HEAD commit OID at clone time so we can detect user modifications later
try {
const headOid = await this.git.resolveRef({ dir: projectPath, ref: 'HEAD' });
await this.git.setConfig({
dir: projectPath,
path: 'shakespeare.clonedAt',
value: headOid,
});
} catch (error) {
console.warn('Failed to store clonedAt commit OID:', error);
}
if (!fork) {
// Set up 'shakespeare.autosync' config for non-forked repositories
await this.git.setConfig({