[gnome-builder/editor-layout] change-monitor: show line as ADDED if new file in git tree.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/editor-layout] change-monitor: show line as ADDED if new file in git tree.
- Date: Mon, 1 Dec 2014 07:01:04 +0000 (UTC)
commit 8cbbeec39eb99af144520f1a8955b9cefcb60661
Author: Christian Hergert <christian hergert me>
Date: Sun Nov 30 22:50:29 2014 -0800
change-monitor: show line as ADDED if new file in git tree.
src/editor/gb-source-change-monitor.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/editor/gb-source-change-monitor.c b/src/editor/gb-source-change-monitor.c
index a218aab..b5bd111 100644
--- a/src/editor/gb-source-change-monitor.c
+++ b/src/editor/gb-source-change-monitor.c
@@ -85,6 +85,14 @@ gb_source_change_monitor_get_line (GbSourceChangeMonitor *monitor,
return (GPOINTER_TO_INT (value) & GB_SOURCE_CHANGE_MASK);
}
+ /*
+ * If we found a repository, but don't have state, then we are
+ * possibly just a new file in the repository. Mark the line as
+ * added.
+ */
+ if (monitor->priv->repo)
+ return GB_SOURCE_CHANGE_ADDED;
+
return GB_SOURCE_CHANGE_NONE;
}
@@ -682,6 +690,5 @@ gb_source_change_monitor_init (GbSourceChangeMonitor *monitor)
{
ENTRY;
monitor->priv = gb_source_change_monitor_get_instance_private (monitor);
- monitor->priv->state = g_hash_table_new (g_direct_hash, g_direct_equal);
EXIT;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]