diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2010-08-17 11:06:06 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-19 01:02:04 +0400 |
commit | f5d3a6f575b12af88561ad5a3b1fc8f866f49056 (patch) | |
tree | 17c76b73b9eecf9452135ea56dabf2e678974524 /contrib/examples/git-merge.sh | |
parent | e69dccf8cd4576be804597b2960aa7d0020a65db (diff) |
merge script: forbid merge -s index
Some git-merge-* commands are not merge strategies. This is based on
v1.6.1-rc1~294^2~7 (builtin-merge: allow using a custom strategy,
2008-07-30) but it is less smart: we just use a hard-coded list of
forbidden strategy names. It is okay if this falls out of date, since
the code is just an example.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/examples/git-merge.sh')
-rwxr-xr-x | contrib/examples/git-merge.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh index 49d8265083..bab3da9eec 100755 --- a/contrib/examples/git-merge.sh +++ b/contrib/examples/git-merge.sh @@ -36,6 +36,7 @@ LF=' all_strategies='recur recursive octopus resolve stupid ours subtree' all_strategies="$all_strategies recursive-ours recursive-theirs" +not_strategies='base file index tree' default_twohead_strategies='recursive' default_octopus_strategies='octopus' no_fast_forward_strategies='subtree ours' @@ -196,6 +197,10 @@ parse_config () { use_strategies="$use_strategies$1 " ;; *) + case " $not_strategies " in + *" $1 "*) + false + esac && type "git-merge-$1" >/dev/null 2>&1 || die "available strategies are: $all_strategies" use_strategies="$use_strategies$1 " |