mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Merge 54076119f2 into 2ebd201da9
This commit is contained in:
commit
03adcba598
1 changed files with 27 additions and 3 deletions
|
|
@ -543,7 +543,9 @@ export default class SyncManager {
|
|||
break;
|
||||
}
|
||||
case "delete_remote": {
|
||||
newTreeFiles[action.filePath].sha = null;
|
||||
if (newTreeFiles[action.filePath]) {
|
||||
newTreeFiles[action.filePath].sha = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "download":
|
||||
|
|
@ -858,7 +860,18 @@ export default class SyncManager {
|
|||
// on them if it makes the plugin handle upload better on certain devices.
|
||||
if (hasTextExtension(filePath)) {
|
||||
const sha = await this.calculateSHA(filePath);
|
||||
this.metadataStore.data.files[filePath].sha = sha;
|
||||
if (this.metadataStore.data.files[filePath]) {
|
||||
this.metadataStore.data.files[filePath].sha = sha;
|
||||
} else {
|
||||
this.metadataStore.data.files[filePath] = {
|
||||
path: filePath,
|
||||
sha: sha,
|
||||
dirty: false,
|
||||
justDownloaded: false,
|
||||
lastModified: syncTime,
|
||||
deleted: false,
|
||||
};
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -875,7 +888,18 @@ export default class SyncManager {
|
|||
treeFiles[filePath].sha = sha;
|
||||
// Can't have both sha and content set, so we delete it
|
||||
delete treeFiles[filePath].content;
|
||||
this.metadataStore.data.files[filePath].sha = sha;
|
||||
if (this.metadataStore.data.files[filePath]) {
|
||||
this.metadataStore.data.files[filePath].sha = sha;
|
||||
} else {
|
||||
this.metadataStore.data.files[filePath] = {
|
||||
path: filePath,
|
||||
sha: sha,
|
||||
dirty: false,
|
||||
justDownloaded: false,
|
||||
lastModified: syncTime,
|
||||
deleted: false,
|
||||
};
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue