Skip to content

Instantly share code, notes, and snippets.

View nothingmuch's full-sized avatar
🤔

Yuval Kogman nothingmuch

🤔
View GitHub Profile
From 4742ba64e7c20f7d60acdd411201f7aa971b462a Mon Sep 17 00:00:00 2001
From: Yuval Kogman <nothingmuch@woobling.org>
Date: Wed, 28 Jan 2009 14:30:08 +0200
Subject: [PATCH] Add --ff-only flag to git-merge
This patch adds an --ff-only flag to git-merge. When specified git-merge
will exit with an error whenver a merge will not be a simple fast
forward, similar to the default behavior of git push.
---
builtin-merge.c | 6 ++++++
#!/usr/bin/perl -w
use strict;
use KiokuDB;
use KiokuDB::Backend::DBI;
{
package test;
use Moose;
use strict;
use warnings;
use Test::More 'no_plan';
use KiokuX::User::Util qw(crypt_password);
use ok 'Kitten::Friend::Schema::Kitten';
my $kitten = Kitten::Friend::Schema::Kitten->new(
package Kitten::Friend::Model::KiokuDB;
use Moose;
extends qw(KiokuX::Model);
sub insert_kitten {
my ( $self, $kitten ) = @_;
my $id = $self->txn_do(sub {
$self->store($kitten);
my $user = eval {
$c->authenticate({
id => $id,
password => $password,
});
};
if ( $user ) {
$c->response->body( "Hello " . $user->get_object->name )
}
<Model KiokuDB>
dsn dbi:SQLite:dbname=root/db
</Model>
__PACKAGE__->config(
'Plugin::Authentication' => {
realms => {
default => {
credential => {
class => 'Password',
password_type => 'self_check'
},
store => {
class => 'Model::KiokuDB',
package Kitten::Friend::Schema::Kitten;
use Moose;
use Kitten::Friend::Schema::Vase;
use KiokuDB::Set;
use KiokuDB::Util qw(set);
use namespace::autoclean;
package Kitten::Friend::Schema::Vase;
use Moose;
use MooseX::AttributeHelpers;
use URI;
use namespace::autoclean;
has pictures => (
metaclass => "Collection::Array",
use strict;
use warnings;
use Test::More 'no_plan';
use ok 'Kitten::Friend::Model::KiokuDB';
my $m = Kitten::Friend::Model::KiokuDB->new( dsn => "hash" );
{