[gnome-builder] git: watch .git/index for changes rather than .git/HEAD
- From: Matthew Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] git: watch .git/index for changes rather than .git/HEAD
- Date: Fri, 3 Feb 2017 19:01:23 +0000 (UTC)
commit 01b648f21e0b31595a8086e61cc0253e0ae3a290
Author: Matthew Leeds <mleeds redhat com>
Date: Fri Feb 3 12:51:30 2017 -0600
git: watch .git/index for changes rather than .git/HEAD
By watching the index for changes, IdeGitVcs can emit the "reloaded" and
"changed" signals when commits happen rather than just when the current
branch changes. This makes the git gutter for open files (showing lines
added/changed/removed) update automatically when necessary.
plugins/git/ide-git-vcs.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/git/ide-git-vcs.c b/plugins/git/ide-git-vcs.c
index a68af3c..f3e2993 100644
--- a/plugins/git/ide-git-vcs.c
+++ b/plugins/git/ide-git-vcs.c
@@ -314,12 +314,12 @@ ide_git_vcs_load_monitor (IdeGitVcs *self,
{
g_autoptr(GFile) location = NULL;
g_autoptr(GFileMonitor) monitor = NULL;
- g_autoptr(GFile) heads_dir = NULL;
+ g_autoptr(GFile) index_file = NULL;
GError *local_error = NULL;
location = ggit_repository_get_location (self->repository);
- heads_dir = g_file_get_child (location, "HEAD");
- monitor = g_file_monitor (heads_dir, 0, NULL, &local_error);
+ index_file = g_file_get_child (location, "index");
+ monitor = g_file_monitor (index_file, 0, NULL, &local_error);
if (monitor == NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]