@@ -406,7 +406,18 @@ def __post_init__(self) -> None:
406
406
default_branch = repo ["default_branch" ]
407
407
408
408
object .__setattr__ (self , "base" , default_branch )
409
- object .__setattr__ (self , "direct" , bool (self .direct_opt ))
409
+
410
+ # Check if direct should be used, if the user didn't explicitly
411
+ # specify an option
412
+ direct = self .direct_opt
413
+ if direct is None :
414
+ direct_r = self .sh .git (
415
+ "cat-file" , "-e" , "HEAD:.github/ghstack_direct" , exitcode = True
416
+ )
417
+ assert isinstance (direct_r , bool )
418
+ direct = direct_r
419
+
420
+ object .__setattr__ (self , "direct" , direct )
410
421
411
422
# ~~~~~~~~~~~~~~~~~~~~~~~~
412
423
# The main algorithm
@@ -667,7 +678,6 @@ def prepare_updates(
667
678
commits_to_submit : List [ghstack .git .CommitHeader ],
668
679
commits_to_rebase : List [ghstack .git .CommitHeader ],
669
680
) -> Tuple [Dict [GitCommitHash , DiffMeta ], Dict [GitCommitHash , GitCommitHash ]]:
670
-
671
681
# Prepare diffs in reverse topological order.
672
682
# (Reverse here is important because we must have processed parents
673
683
# first.)
0 commit comments