[gnome-builder] git: short-circuit when on remote file-system
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] git: short-circuit when on remote file-system
- Date: Sun, 19 Jan 2020 22:18:20 +0000 (UTC)
commit 7e242650786e61c4411c508f56fa60cdfc84280d
Author: Christian Hergert <chergert redhat com>
Date: Sun Jan 19 14:17:58 2020 -0800
git: short-circuit when on remote file-system
libgit2 only allows using native file API. So while this works when using
sshfs with a mount, it does not work when using scp:// style URIs.
This checks for a local mount and ignores git setup when we discover we
cannot use libgit2.
Related: #1129
src/plugins/git/gbp-git-workbench-addin.c | 9 +++++++++
1 file changed, 9 insertions(+)
---
diff --git a/src/plugins/git/gbp-git-workbench-addin.c b/src/plugins/git/gbp-git-workbench-addin.c
index 4404b4cf3..51ad4b58d 100644
--- a/src/plugins/git/gbp-git-workbench-addin.c
+++ b/src/plugins/git/gbp-git-workbench-addin.c
@@ -149,6 +149,15 @@ gbp_git_workbench_addin_load_project_service_cb (GObject *object,
project_info = ide_task_get_task_data (task);
directory = ide_project_info_get_directory (project_info);
+ if (!g_file_is_native (directory))
+ {
+ ide_task_return_new_error (task,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ "Cannot initialize git, not a local file-system");
+ return;
+ }
+
ipc_git_service_call_discover (service,
g_file_peek_path (directory),
ide_task_get_cancellable (task),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]