|
|
|
@ -368,6 +368,31 @@ sub revert_commit { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub restore_commit { |
|
|
|
|
|
|
|
my ( $self, $commit ) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Check that the repo exists and is latest. |
|
|
|
|
|
|
|
$self->_ensure_repository_is_latest; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Restore the commit. |
|
|
|
|
|
|
|
$self->system_command( [ qw( git restore --source ), $commit, qw( -W -S --theirs :/ ) ], { |
|
|
|
|
|
|
|
chdir => $self->repo_path, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Restore the commit. |
|
|
|
|
|
|
|
$self->system_command( [ qw( git commit -m ), "Restored from $commit" ], { |
|
|
|
|
|
|
|
chdir => $self->repo_path, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Push the repo to the store server |
|
|
|
|
|
|
|
$self->system_command( [ qw( git push origin master ) ], { |
|
|
|
|
|
|
|
chdir => $self->repo_path, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sub delete_post { |
|
|
|
sub delete_post { |
|
|
|
my ( $self, $title, $file ) = @_; |
|
|
|
my ( $self, $title, $file ) = @_; |
|
|
|
|
|
|
|
|
|
|
|
|