-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CFE-3967: cfbs no longer tries to commit when there is no diff #187
Conversation
1484f27
to
5dd4a8d
Compare
Should get you closer to passing CI
|
e49afe4
to
5de3401
Compare
5de3401
to
6b54be1
Compare
cfbs/git.py
Outdated
except CalledProcessError as cpe: | ||
return False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When does this happen? Deserves at least a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might happen if, for example the command fired not in a git repository
I'm not sure what should be the expected behavior :)
Maybe it's better to raise Exception?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see.
In that case I'd probably do:
user_error("Failed to run 'git status -s -u' to check for changes.")
Also, please ensure that your change works for projects not using git committing ("git": false
in cfbs.json
).
cfbs/git.py
Outdated
changes = list( | ||
map( | ||
lambda m: m.strip().split(" ")[1], | ||
list(filter(None, result.stdout.decode("utf-8").split("\n"))), | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mineralsfree something like this should work, and might be considered more readable :)
changes = list( | |
map( | |
lambda m: m.strip().split(" ")[1], | |
list(filter(None, result.stdout.decode("utf-8").split("\n"))), | |
) | |
) | |
lines = result.stdout.decode("utf-8").split("\n") | |
changes = [line.strip().split(" ")[1] for line in lines if line] |
6b54be1
to
3482972
Compare
Ticket: CFE-3967 Changelog: None Signed-off-by: Mikita Pilinka <mikita.pilinka@northern.tech>
3482972
to
57fae2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Ticket: CFE-3967
Changelog: None
Signed-off-by: Mikita Pilinka mikita.pilinka@northern.tech