Skip to content

Commit e730b81

Browse files
newrengitster
authored andcommitted
Move definition of enum branch_track from cache.h to branch.h
'branch_track' feels more closely related to branching, and it is needed later in branch.h; rather than #include'ing cache.h in branch.h for this small enum, just move the enum and the external declaration for git_branch_track to branch.h. Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1731310 commit e730b81

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

branch.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33

44
struct strbuf;
55

6+
enum branch_track {
7+
BRANCH_TRACK_UNSPECIFIED = -1,
8+
BRANCH_TRACK_NEVER = 0,
9+
BRANCH_TRACK_REMOTE,
10+
BRANCH_TRACK_ALWAYS,
11+
BRANCH_TRACK_EXPLICIT,
12+
BRANCH_TRACK_OVERRIDE
13+
};
14+
15+
extern enum branch_track git_branch_track;
16+
617
/* Functions for acting on the information about branches. */
718

819
/*

cache.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -919,15 +919,6 @@ enum log_refs_config {
919919
};
920920
extern enum log_refs_config log_all_ref_updates;
921921

922-
enum branch_track {
923-
BRANCH_TRACK_UNSPECIFIED = -1,
924-
BRANCH_TRACK_NEVER = 0,
925-
BRANCH_TRACK_REMOTE,
926-
BRANCH_TRACK_ALWAYS,
927-
BRANCH_TRACK_EXPLICIT,
928-
BRANCH_TRACK_OVERRIDE
929-
};
930-
931922
enum rebase_setup_type {
932923
AUTOREBASE_NEVER = 0,
933924
AUTOREBASE_LOCAL,
@@ -944,7 +935,6 @@ enum push_default_type {
944935
PUSH_DEFAULT_UNSPECIFIED
945936
};
946937

947-
extern enum branch_track git_branch_track;
948938
extern enum rebase_setup_type autorebase;
949939
extern enum push_default_type push_default;
950940

config.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*
77
*/
88
#include "cache.h"
9+
#include "branch.h"
910
#include "config.h"
1011
#include "repository.h"
1112
#include "lockfile.h"

environment.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* are.
99
*/
1010
#include "cache.h"
11+
#include "branch.h"
1112
#include "repository.h"
1213
#include "config.h"
1314
#include "refs.h"

0 commit comments

Comments
 (0)