Commit a420346
Consolidate git root discovery and remove Paths.GitCommonRoot static
Three changes:
1. FileSystemFactory.FindGitRoot removed — ForPath/ForPathWrite now call
Paths.FindGitRoot, which is the single canonical git-root walker.
2. Paths.DetermineSourceDirectoryRoot simplified — the loop body had a
dead branch (checked GetDirectories.Length == 0 in the while condition
then re-checked inside). Rewritten to a clean while-loop matching
FindGitRoot's structure; semantics unchanged.
3. Paths.GitCommonRoot static field and InitGitCommonRoot removed —
the static ran complex logic (ScopedFileSystem creation + file read)
at class init time and was only used by AssembleContext and CodexContext.
Both now call Paths.ResolveGitCommonRoot(readFileSystem, workingRoot)
directly, which is already public and takes explicit dependencies.
Paths.cs no longer references Nullean.ScopedFileSystem.
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>1 parent a385472 commit a420346
4 files changed
Lines changed: 36 additions & 42 deletions
File tree
- src
- Elastic.Codex
- Elastic.Documentation.Configuration
- services/Elastic.Documentation.Assembler
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
Lines changed: 2 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | 146 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | | - | |
16 | | - | |
17 | 14 | | |
18 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
19 | 36 | | |
20 | 37 | | |
21 | 38 | | |
| |||
33 | 50 | | |
34 | 51 | | |
35 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
36 | 57 | | |
37 | 58 | | |
38 | | - | |
39 | 59 | | |
40 | | - | |
| 60 | + | |
41 | 61 | | |
42 | 62 | | |
43 | | - | |
| 63 | + | |
44 | 64 | | |
45 | 65 | | |
46 | | - | |
47 | | - | |
| 66 | + | |
48 | 67 | | |
49 | 68 | | |
50 | | - | |
51 | | - | |
| 69 | + | |
52 | 70 | | |
53 | 71 | | |
54 | 72 | | |
| |||
80 | 98 | | |
81 | 99 | | |
82 | 100 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
| |||
0 commit comments