5
5
//! parent directory, and otherwise documentation can be found throughout the `build`
6
6
//! directory in each respective module.
7
7
8
- use std:: fs:: { self , OpenOptions } ;
9
- use std:: io:: { self , BufRead , BufReader , IsTerminal , Write } ;
10
- use std:: str:: FromStr ;
11
- use std:: { env, process} ;
12
-
13
8
use bootstrap:: {
14
9
Build , CONFIG_CHANGE_HISTORY , Config , Flags , Subcommand , debug, find_recent_config_change_ids,
15
10
human_readable_changes, t,
16
11
} ;
17
12
use build_helper:: ci:: CiEnv ;
13
+ use build_helper:: git:: get_closest_merge_commit;
14
+ use std:: fs:: { self , OpenOptions } ;
15
+ use std:: io:: { self , BufRead , BufReader , IsTerminal , Write } ;
16
+ use std:: process:: Command ;
17
+ use std:: str:: FromStr ;
18
+ use std:: { env, process} ;
18
19
#[ cfg( feature = "tracing" ) ]
19
20
use tracing:: instrument;
20
21
@@ -34,6 +35,14 @@ fn main() {
34
35
debug ! ( "parsing config based on flags" ) ;
35
36
let config = Config :: parse ( flags) ;
36
37
38
+ let merge_commit =
39
+ get_closest_merge_commit ( Some ( & config. src ) , & config. git_config ( ) , & [ ] ) . unwrap ( ) ;
40
+ let current_commit = String :: from_utf8 (
41
+ Command :: new ( "git" ) . arg ( "rev-parse" ) . arg ( "HEAD" ) . output ( ) . unwrap ( ) . stdout ,
42
+ )
43
+ . unwrap ( ) ;
44
+ panic ! ( "Merge commit: {merge_commit}, HEAD: {current_commit}" ) ;
45
+
37
46
let mut build_lock;
38
47
let _build_lock_guard;
39
48
0 commit comments