Skip to content

Commit 3fa5f64

Browse files
committed
[amtool] (#10231) Prevent pushes if there are uncommitted changes in the tree
1 parent b9c8668 commit 3fa5f64

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

apple-ci/amtool

+9
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,15 @@ def main():
327327
except GitError:
328328
pass
329329

330+
# Check if we have any unstaged or uncommitted changes in the tree
331+
try:
332+
if len(git('diff-index', 'HEAD')) != 0:
333+
log.error('Looks like you have unstaged or uncommitted changes')
334+
log.error('Please make sure everything has been added to the commit')
335+
return 1
336+
except GitError:
337+
pass
338+
330339
# Save the commit sha so that we can include it in the output message.
331340
merge_commit = git('rev-parse', 'HEAD')
332341

0 commit comments

Comments
 (0)