diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-06 21:27:05 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-07 00:12:30 +0200 |
commit | f23e8decd544c8f81b40c98211f6cb028fa70cdc (patch) | |
tree | 46722262fd27b289b619373a331794397f481c1c /builtin/merge.c | |
parent | Merge branch 'jc/maint-branch-mergeoptions' into mg/merge-ff-config (diff) | |
download | git-f23e8decd544c8f81b40c98211f6cb028fa70cdc.tar.xz git-f23e8decd544c8f81b40c98211f6cb028fa70cdc.zip |
merge: introduce merge.ff configuration variable
This variable gives the default setting for --ff, --no-ff or --ff-only
options of "git merge" command.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge.c')
-rw-r--r-- | builtin/merge.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index 0f03dff116..65c79630f0 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -550,6 +550,15 @@ static int git_merge_config(const char *k, const char *v, void *cb) if (is_bool && shortlog_len) shortlog_len = DEFAULT_MERGE_LOG_LEN; return 0; + } else if (!strcmp(k, "merge.ff")) { + int boolval = git_config_maybe_bool(k, v); + if (0 <= boolval) { + allow_fast_forward = boolval; + } else if (v && !strcmp(v, "only")) { + allow_fast_forward = 1; + fast_forward_only = 1; + } /* do not barf on values from future versions of git */ + return 0; } else if (!strcmp(k, "merge.defaulttoupstream")) { default_to_upstream = git_config_bool(k, v); return 0; |