* Returns the default configured value for --rebase. It first looks for the * value of "branch.$curr_branch.rebase", where $curr_branch is the current * branch, and if HEAD is detached or the configuration key does not exist, * looks for the value of "pull.rebase". If both configuration keys do not * exist, returns REBASE_FALSE. */
| 196 | * exist, returns REBASE_FALSE. |
| 197 | */ |
| 198 | static enum rebase_type config_get_rebase(int *rebase_unspecified) |
| 199 | { |
| 200 | struct branch *curr_branch = branch_get("HEAD"); |
| 201 | const char *value; |
| 202 | |
| 203 | if (curr_branch) { |
| 204 | char *key = xstrfmt("branch.%s.rebase", curr_branch->name); |
| 205 | |
| 206 | if (!repo_config_get_value(the_repository, key, &value)) { |
| 207 | enum rebase_type ret = parse_config_rebase(key, value, 1); |
| 208 | free(key); |
| 209 | return ret; |
| 210 | } |
| 211 | |
| 212 | free(key); |
| 213 | } |
| 214 | |
| 215 | if (!repo_config_get_value(the_repository, "pull.rebase", &value)) |
| 216 | return parse_config_rebase("pull.rebase", value, 1); |
| 217 | |
| 218 | *rebase_unspecified = 1; |
| 219 | |
| 220 | return REBASE_FALSE; |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * Read config variables. |
no test coverage detected