From 407123a2800545f8f8de8bae448b8019b5ec6648 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 1 Feb 2018 17:07:46 +0000 Subject: [PATCH] Add git_pull_unrelated_history handling --- editor/js/ui/projects/tab-versionControl.js | 3 +++ red/runtime/storage/localfilesystem/projects/git/index.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/editor/js/ui/projects/tab-versionControl.js b/editor/js/ui/projects/tab-versionControl.js index a5353fc95..3c308e1b2 100644 --- a/editor/js/ui/projects/tab-versionControl.js +++ b/editor/js/ui/projects/tab-versionControl.js @@ -894,6 +894,9 @@ RED.sidebar.versionControl = (function() { 'unexpected_error': function(error) { console.log(error); // done(error,null); + }, + 'git_pull_unrelated_history': function(error) { + RED.notify("Unable to pull remote changes; refusing to merge unrelated histories.","error"); } }, } diff --git a/red/runtime/storage/localfilesystem/projects/git/index.js b/red/runtime/storage/localfilesystem/projects/git/index.js index 0851f2257..451b11e95 100644 --- a/red/runtime/storage/localfilesystem/projects/git/index.js +++ b/red/runtime/storage/localfilesystem/projects/git/index.js @@ -67,6 +67,8 @@ function runGitCommand(args,cwd,env) { err.code = "git_not_a_repository"; } else if (/Repository not found/i.test(stderr)) { err.code = "git_repository_not_found"; + } else if (/refusing to merge unrelated histories/.test(stderr)) { + err.code = "git_pull_unrelated_history" } return reject(err); }