Small cleanup around changelog resets
This commit is contained in:
parent
de23cff1cc
commit
dc4b0980b0
@ -389,6 +389,10 @@ std::tuple<bool, std::set<std::string>> CiLogic::build_project(std::shared_ptr<P
|
|||||||
proj->upstream_version = base_git_ver + "~" + proj->release->codename;
|
proj->upstream_version = base_git_ver + "~" + proj->release->codename;
|
||||||
sync(proj);
|
sync(proj);
|
||||||
|
|
||||||
|
// Reset changelog after dch (so pending changes aren't committed)
|
||||||
|
reset_changelog(packaging_dir.parent_path() / proj->package->name, changelog);
|
||||||
|
log->append("Reset debian/changelog to HEAD...");
|
||||||
|
|
||||||
// Update changelog for this release
|
// Update changelog for this release
|
||||||
update_changelog(packaging_dir, proj->release->codename, proj->upstream_version, std::to_string(proj->ppa_revision), log);
|
update_changelog(packaging_dir, proj->release->codename, proj->upstream_version, std::to_string(proj->ppa_revision), log);
|
||||||
log->append("Changelog updated, copying the packaging...");
|
log->append("Changelog updated, copying the packaging...");
|
||||||
@ -398,7 +402,7 @@ std::tuple<bool, std::set<std::string>> CiLogic::build_project(std::shared_ptr<P
|
|||||||
copy_directory(packaging_dir, dest_dir);
|
copy_directory(packaging_dir, dest_dir);
|
||||||
log->append("Copied packaging to " + dest_dir.string() + ", copying tarball...");
|
log->append("Copied packaging to " + dest_dir.string() + ", copying tarball...");
|
||||||
|
|
||||||
// Reset changelog after dchd$ (so local changes aren't committed)
|
// Reset changelog after dch (so local changes aren't committed)
|
||||||
reset_changelog(packaging_dir.parent_path() / proj->package->name, changelog);
|
reset_changelog(packaging_dir.parent_path() / proj->package->name, changelog);
|
||||||
log->append("Reset debian/changelog to HEAD...");
|
log->append("Reset debian/changelog to HEAD...");
|
||||||
|
|
||||||
|
@ -504,6 +504,9 @@ void clone_or_fetch(const std::filesystem::path &repo_dir,
|
|||||||
* reset_changelog to HEAD content
|
* reset_changelog to HEAD content
|
||||||
*/
|
*/
|
||||||
void reset_changelog(const fs::path &repo_dir, const fs::path &changelog_path) {
|
void reset_changelog(const fs::path &repo_dir, const fs::path &changelog_path) {
|
||||||
|
// Remove the .dch path first
|
||||||
|
std::remove((std::string{changelog_path.string()} + ".dch").c_str());
|
||||||
|
|
||||||
git_repository *repo = nullptr;
|
git_repository *repo = nullptr;
|
||||||
if (git_repository_open(&repo, repo_dir.c_str()) != 0) {
|
if (git_repository_open(&repo, repo_dir.c_str()) != 0) {
|
||||||
const git_error *e = git_error_last();
|
const git_error *e = git_error_last();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user