Thread (34 messages) 34 messages, 3 authors, 2016-06-15

Re: [PATCH 06/14] pull: support pull.ff config

From: Paul Tan <hidden>
Date: 2016-06-15 23:04:51

Hi,

On Tue, May 19, 2015 at 3:02 AM, Johannes Schindelin
[off-list ref] wrote:
Hi Paul,

On 2015-05-18 17:06, Paul Tan wrote:
quoted
diff --git a/builtin/pull.c b/builtin/pull.c
index 8982fdf..b305a47 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -209,6 +209,28 @@ static void argv_push_force(struct argv_array *arr)
              argv_array_push(arr, "-f");
 }

+/**
+ * If pull.ff is "true", returns "--ff". If pull.ff is "false", returns
+ * "--no-ff". If pull.ff is "only", returns "--ff-only". Otherwise, returns
+ * NULL.
+ */
+static const char *config_get_ff(void)
+{
+     const char *value;
+
+     if (git_config_get_value("pull.ff", &value))
+             return NULL;
+     switch (git_config_maybe_bool("pull.ff", value)) {
+             case 0:
+                     return "--no-ff";
+             case 1:
+                     return "--ff";
+     }
+     if (!strcmp("pull.ff", "only"))
I think you want to test `!strcmp("only", value)` ;-)
Ugh >.<

Fixed, thanks for catching.

Regards,
Paul
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help