27
27
#include "commit-reach.h"
28
28
#include "sequencer.h"
29
29
30
- static int default_mode ;
31
-
32
30
/**
33
31
* Parses the value of --rebase. If value is a false value, returns
34
32
* REBASE_FALSE. If value is a true value, returns REBASE_TRUE. If value is
@@ -326,7 +324,7 @@ static const char *config_get_ff(void)
326
324
* looks for the value of "pull.rebase". If both configuration keys do not
327
325
* exist, returns REBASE_FALSE.
328
326
*/
329
- static enum rebase_type config_get_rebase (void )
327
+ static enum rebase_type config_get_rebase (int * rebase_unspecified )
330
328
{
331
329
struct branch * curr_branch = branch_get ("HEAD" );
332
330
const char * value ;
@@ -346,7 +344,7 @@ static enum rebase_type config_get_rebase(void)
346
344
if (!git_config_get_value ("pull.rebase" , & value ))
347
345
return parse_config_rebase ("pull.rebase" , value , 1 );
348
346
349
- default_mode = 1 ;
347
+ * rebase_unspecified = 1 ;
350
348
351
349
return REBASE_FALSE ;
352
350
}
@@ -934,6 +932,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
934
932
struct object_id orig_head , curr_head ;
935
933
struct object_id rebase_fork_point ;
936
934
int autostash ;
935
+ int rebase_unspecified = 0 ;
937
936
938
937
if (!getenv ("GIT_REFLOG_ACTION" ))
939
938
set_reflog_message (argc , argv );
@@ -955,7 +954,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
955
954
opt_ff = xstrdup_or_null (config_get_ff ());
956
955
957
956
if (opt_rebase < 0 )
958
- opt_rebase = config_get_rebase ();
957
+ opt_rebase = config_get_rebase (& rebase_unspecified );
959
958
960
959
if (read_cache_unmerged ())
961
960
die_resolve_conflict ("pull" );
@@ -1029,7 +1028,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
1029
1028
if (opt_rebase && merge_heads .nr > 1 )
1030
1029
die (_ ("Cannot rebase onto multiple branches." ));
1031
1030
1032
- if (default_mode && opt_verbosity >= 0 && !opt_ff ) {
1031
+ if (rebase_unspecified && opt_verbosity >= 0 && !opt_ff ) {
1033
1032
advise (_ ("Pulling without specifying how to reconcile divergent branches is\n"
1034
1033
"discouraged. You can squelch this message by running one of the following\n"
1035
1034
"commands sometime before your next pull:\n"
0 commit comments