Don't try to commit unchanged specs on push #1199

Merged
merged 2 commits into from Jul 15, 2013

3 participants

@shekibobo

If multiple podspecs exist in a directory, and I run 'pod push my-repo' when some of those podspecs haven't changed, the push raises an exception when trying to run 'git commit' with no changes.

I propose we simply notify that the file is unchanged and allow the process to continue, rather than exiting the process.

This PR simply checks to see if the git diff for the file actually has a change before it attempts to add and commit.

@shekibobo

Looks like 8c95e0e doesn't work, in part because git diff returns blank for new untracked files... Looking into it.

@coveralls

Coverage Status

Coverage remained the same when pulling 8c95e0e on shekibobo:pod-push-unchanged into 1fd8740 on CocoaPods:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 6560783 on shekibobo:pod-push-unchanged into 1fd8740 on CocoaPods:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 6918efc on shekibobo:pod-push-unchanged into 1fd8740 on CocoaPods:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 7a899e9 on shekibobo:pod-push-unchanged into 1fd8740 on CocoaPods:master.

@shekibobo

Note that in order to get tests to pass, I had to change the fixture path from /master to /test_repo.

@coveralls

Coverage Status

Coverage remained the same when pulling 387698a on shekibobo:pod-push-unchanged into 1fd8740 on CocoaPods:master.

@fabiopelosin
CocoaPods member

👍 Looks good to me, do you mind adding a note in Changelog?

@shekibobo

That okay? I'm not sure whether this would fall under bug fixes or enhancements.

@coveralls

Coverage Status

Coverage remained the same when pulling bf741f0 on shekibobo:pod-push-unchanged into 1fd8740 on CocoaPods:master.

@fabiopelosin
CocoaPods member

That okay? I'm not sure whether this would fall under bug fixes or enhancements.

I would consider that a minor enhancement 😄

Thanks for the contribution btw!

@fabiopelosin fabiopelosin merged commit dc92827 into CocoaPods:master Jul 15, 2013

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment