mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
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:
3 files changed
+47
-11
No files matched your search
@@ -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({
|
||||
|
||||
Reference in new issue
Block a user