hastexo / olx-utils

Tools facilitating the creation of Open edX courseware in the Open Learning XML (OLX) format
GNU Affero General Public License v3.0
5 stars 5 forks source link

Make new-run fail if base branch isn't clean #37

Closed fghaas closed 5 years ago

fghaas commented 5 years ago

This is something that has irked me for a while, so here's a PR to finally fix it:

The fact that new-run does and unconditional git add . is troublesome in that it may cause content to be included in a course run that isn't meant to be there.

Thus, if we are configured to create a new branch, check that the base branch is clean (meaning: "git status --porcelain" returns the empty string) before creating a new branch.

codecov-io commented 5 years ago

Codecov Report

Merging #37 into master will increase coverage by 0.18%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #37      +/-   ##
==========================================
+ Coverage   99.64%   99.82%   +0.18%     
==========================================
  Files          11       11              
  Lines         568      582      +14     
==========================================
+ Hits          566      581      +15     
+ Misses          2        1       -1
Impacted Files Coverage Δ
tests/test_full_course.py 100% <100%> (ø) :arrow_up:
olxutils/cli.py 98.93% <100%> (+1.08%) :arrow_up:
olxutils/git.py 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3f65c27...b7ca576. Read the comment docs.