Skip to content

Commit 863f628

Browse files
committed
fix: Transaction-time check for external mods
At transaction-execute time, StGit checks to see if any intervening changes to the branch were made with external tools (i.e. with git commands). If the branch head has changed, StGit records an updated stack state that reflects this new head. The external modification check was failing to trigger when no patches were applied even if the branch head had changed. This test is repaired.
1 parent fe2e485 commit 863f628

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stack/stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ impl<'repo> Stack<'repo> {
166166

167167
/// Check whether the stack's recorded head matches the branch's head.
168168
pub fn is_head_top(&self) -> bool {
169-
self.state.applied.is_empty() || self.state.head.id() == self.branch_head.id()
169+
self.state.head.id() == self.branch_head.id()
170170
}
171171

172172
/// Return an error if the stack's recorded head differs from the branch's head.
173173
pub fn check_head_top_mismatch(&self) -> Result<()> {
174-
if self.is_head_top() {
174+
if self.state.applied.is_empty() || self.is_head_top() {
175175
Ok(())
176176
} else {
177177
Err(anyhow!(

0 commit comments

Comments
 (0)