mirror of
https://github.com/silvanocerza/github-gitless-sync.git
synced 2026-07-22 12:10:28 +00:00
Handle corner case in conflict check
This commit is contained in:
parent
e4409cb96e
commit
7d389f8e0c
1 changed files with 9 additions and 2 deletions
|
|
@ -446,10 +446,17 @@ export default class SyncManager {
|
|||
remoteFile.sha !== localFile.sha;
|
||||
const localFileHasBeenModifiedSinceLastSync =
|
||||
actualLocalSHA !== localFile.sha;
|
||||
|
||||
// This is an unlikely case. If the user manually edits
|
||||
// the local file so that's identical to the remote one,
|
||||
// but the local metadata SHA is different we don't want
|
||||
// to show a conflict.
|
||||
// Since that would show two identical files.
|
||||
// Checking for this prevents showing a non conflict to the user.
|
||||
const actualFilesAreDifferent = remoteFile.sha !== actualLocalSHA;
|
||||
if (
|
||||
remoteFileHasBeenModifiedSinceLastSync &&
|
||||
localFileHasBeenModifiedSinceLastSync
|
||||
localFileHasBeenModifiedSinceLastSync &&
|
||||
actualFilesAreDifferent
|
||||
) {
|
||||
return filePath;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue