File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
git-commitgraph/src/graph Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ quick_error! {
39
39
}
40
40
}
41
41
42
+ /// Instantiate a `Graph` from various sources
42
43
impl Graph {
43
44
pub fn from_info_dir ( info_dir : impl AsRef < Path > ) -> Result < Self , Error > {
44
45
Self :: from_single_file ( info_dir. as_ref ( ) )
@@ -55,11 +56,10 @@ impl Graph {
55
56
let commit_graphs_dir = commit_graphs_dir. as_ref ( ) ;
56
57
let chain_file_path = commit_graphs_dir. join ( "commit-graph-chain" ) ;
57
58
let chain_file = std:: fs:: File :: open ( & chain_file_path) . map_err ( |e| Error :: Io ( e, chain_file_path. clone ( ) ) ) ?;
58
- let mut files: Vec < File > = Vec :: new ( ) ;
59
+ let mut files = Vec :: new ( ) ;
59
60
for line in BufReader :: new ( chain_file) . lines ( ) {
60
- let line = line. map_err ( |e| Error :: Io ( e, chain_file_path. clone ( ) ) ) ?;
61
- let graph_filename = format ! ( "graph-{}.graph" , line) ;
62
- let graph_file_path = commit_graphs_dir. join ( graph_filename) ;
61
+ let hash = line. map_err ( |e| Error :: Io ( e, chain_file_path. clone ( ) ) ) ?;
62
+ let graph_file_path = commit_graphs_dir. join ( format ! ( "graph-{}.graph" , hash) ) ;
63
63
files. push ( File :: at ( & graph_file_path) . map_err ( |e| Error :: File ( e, graph_file_path. clone ( ) ) ) ?) ;
64
64
}
65
65
Self :: new ( files)
You can’t perform that action at this time.
0 commit comments