hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
0e273418c7cddaa4704a232c332a738d02a5140e
diff --git a/src/Clone.js b/src/Clone.js index <HASH>..<HASH> 100644 --- a/src/Clone.js +++ b/src/Clone.js @@ -230,9 +230,17 @@ export class DocumentCloner { } if (node instanceof HTMLStyleElement && node.sheet && node.sheet.cssRules) { - const css = [].slice - .call(node.sheet.cssRules, 0) - .reduce((css, rule) => css + rule.cssText, ''); + const css = [].slice.call(node.sheet.cssRules, 0).reduce((css, rule) => { + try { + if (rule && rule.cssText) { + return css + rule.cssText; + } + return css; + } catch (err) { + this.logger.log('Unable to access cssText property', rule.name); + return css; + } + }, ''); const style = node.cloneNode(false); style.textContent = css; return style;
IE<I> Member not found fix Wrap accesing the cssText property in a try...catch (#<I>) * <URL>
niklasvh_html2canvas
train
js
e74ec90a073257b91b1760c6e05fbc632d514ca4
diff --git a/activerecord/test/reflection_test.rb b/activerecord/test/reflection_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/reflection_test.rb +++ b/activerecord/test/reflection_test.rb @@ -3,14 +3,21 @@ require 'fixtures/topic' require 'fixtures/customer' require 'fixtures/company' require 'fixtures/company_in_module' +require 'fixtures/subscriber' class ReflectionTest < Test::Unit::TestCase - fixtures :topics, :customers, :companies + fixtures :topics, :customers, :companies, :subscribers def setup @first = Topic.find(1) end + def test_column_null_not_null + subscriber = Subscriber.find(:first) + assert subscriber.column_for_attribute("name").null + assert !subscriber.column_for_attribute("nick").null + end + def test_read_attribute_names assert_equal( %w( id title author_name author_email_address bonus_time written_on last_read content approved replies_count parent_id type ).sort,
added test checking that NOT NULL is properly reflected on [<EMAIL>] closes #<I> git-svn-id: <URL>
rails_rails
train
rb
ecc73eb032882199ae4835e9a3a4a621fa43bbae
diff --git a/phypayload.go b/phypayload.go index <HASH>..<HASH> 100644 --- a/phypayload.go +++ b/phypayload.go @@ -96,8 +96,7 @@ func (h *MHDR) UnmarshalBinary(data []byte) error { return nil } -// PHYPayload represents the physical payload. Use NewPhyPayload for creating -// a new PHYPayload. +// PHYPayload represents the physical payload. type PHYPayload struct { MHDR MHDR MACPayload Payload
Minor documentation fix There is no `NewPhyPayload` function.
brocaar_lorawan
train
go
cb3d9dee4e337d015a3cc6dee8a822f0dfdfcc8f
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -18,7 +18,7 @@ var slice = Array.prototype.slice; // Create singletonian temper usable for constructed pagelets. This will ensure // caching works properly and allows optimize to use temper. // -var temper = new Temper(); +var temper = new Temper; /** * A pagelet is the representation of an item, section, column, widget on the @@ -739,6 +739,11 @@ Pagelet.traverse = function traverse(parent) { }; // +// Make temper available on the constructor, for easy access to the singleton. +// +Pagelet.temper = temper; + +// // Expose the pagelet. // module.exports = Pagelet;
[fix] allow temper access from the constructor object
bigpipe_pagelet
train
js
a4c4a9675be3c6c86e162f4ae7612947ce528ce6
diff --git a/hijack/admin.py b/hijack/admin.py index <HASH>..<HASH> 100755 --- a/hijack/admin.py +++ b/hijack/admin.py @@ -4,7 +4,7 @@ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.core.urlresolvers import reverse from django.template.loader import get_template -from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy as _ from django import VERSION from hijack import settings as hijack_settings
Changed the ugettext to ugettext_lazy This fixes the error message about form plural ValueError: plural forms expression could be dangerous
arteria_django-hijack
train
py
5781bfcb5bef884b4aa4487af5cdbeeaa01fffc7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages from yaml2rst import __version__ long_description = "\n\n".join([ - open("README.txt").read(), + open("README.rst").read(), ]) setup(
Fix: wrong name of README-file in setup.py
debops_yaml2rst
train
py
2959bc9fc8dd83e8c75a96ae5254d33f388ee864
diff --git a/tests/Assert.php b/tests/Assert.php index <HASH>..<HASH> 100644 --- a/tests/Assert.php +++ b/tests/Assert.php @@ -13,6 +13,30 @@ use PHPUnit\Framework\Assert as PhpUnitAssert; final class Assert { /** + * A PHPUnit 4, 7 & 9 compatible version of 'assertRegExp' and its replacement, + * 'assertMatchesRegularExpression'. + * + * This is necessary to avoid warnings - PHPUnit 9 deprecated 'assertRegExp' + * in favour of 'assertMatchesRegularExpression' and outputs a warning if + * the former is used + * + * @param string $regex + * @param string $value + * + * @return void + */ + public static function matchesRegularExpression($regex, $value) + { + if (method_exists(PhpUnitAssert::class, 'assertMatchesRegularExpression')) { + PhpUnitAssert::assertMatchesRegularExpression($regex, $value); + + return; + } + + PhpUnitAssert::assertRegExp($regex, $value); + } + + /** * A replacement for 'assertInternalType', which was removed in PHPUnit 9. * * @param string $type
Add a replacement for regex assertions We can't migrate away from 'assertRegExp' to its replacement ('assertMatchesRegularExpression') because the later doesn't exist in PHPUnit 4 Therefore we need a new regex assertion that calls the right thing
bugsnag_bugsnag-php
train
php
649b5b0b8bd6461c2ecfe7fc8972273dae897138
diff --git a/pkg/cmd/cli/cmd/cancelbuild.go b/pkg/cmd/cli/cmd/cancelbuild.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/cli/cmd/cancelbuild.go +++ b/pkg/cmd/cli/cmd/cancelbuild.go @@ -39,7 +39,7 @@ func NewCmdCancelBuild(fullName string, f *clientcmd.Factory, out io.Writer) *co Short: "Cancel a pending or running build", Long: cancelBuildLong, Example: fmt.Sprintf(cancelBuildExample, fullName), - SuggestFor: []string{"builds"}, + SuggestFor: []string{"builds", "stop-build"}, Run: func(cmd *cobra.Command, args []string) { err := RunCancelBuild(f, out, cmd, args) cmdutil.CheckErr(err)
Make `oc cancel-build` to be suggested for `oc stop-build`.
openshift_origin
train
go
135937924a3b4779cb6261e803d7808e17069b2d
diff --git a/gitmap_test.go b/gitmap_test.go index <HASH>..<HASH> 100644 --- a/gitmap_test.go +++ b/gitmap_test.go @@ -48,8 +48,8 @@ func assertFile( t *testing.T, gm gitmap.GitMap, filename, - expectedAbbreviatedTreeHash, - expectedTreeHash string) { + expectedAbbreviatedHash, + expectedHash string) { var ( gi *gitmap.GitInfo @@ -60,11 +60,15 @@ func assertFile( t.Fatalf(filename) } - if gi.AbbreviatedHash != expectedAbbreviatedTreeHash || gi.Hash != expectedTreeHash { + if gi.AbbreviatedHash != expectedAbbreviatedHash || gi.Hash != expectedHash { t.Error("Invalid tree hash, file", filename, "abbreviated:", gi.AbbreviatedHash, "full:", gi.Hash, gi.Subject) } if gi.AuthorName != "Bjørn Erik Pedersen" || gi.AuthorEmail != "[email protected]" { t.Error("These commits are mine! Got", gi.AuthorName, "and", gi.AuthorEmail) } + + if gi.AuthorDate.Format("2006-01-02") != "2016-07-19" { + t.Error("Invalid date:", gi.AuthorDate) + } }
Add date assertion and fix var names in test
bep_gitmap
train
go
3955445a91a97d0b5235892851f805725ce825a7
diff --git a/components/api/src/main/java/org/openengsb/core/api/security/model/Permission.java b/components/api/src/main/java/org/openengsb/core/api/security/model/Permission.java index <HASH>..<HASH> 100644 --- a/components/api/src/main/java/org/openengsb/core/api/security/model/Permission.java +++ b/components/api/src/main/java/org/openengsb/core/api/security/model/Permission.java @@ -27,7 +27,6 @@ package org.openengsb.core.api.security.model; * <li>the {@link Object#toString()} must create a string-representation that can be used with that constructor the * recreate the object</li> * </ul> - * This works fine with all wrapped primitive types. * * Collections of values are also allowed. However the types of the values underly the same constraints as single * values.
[OPENENGSB-<I>] fix permission-doc
openengsb_openengsb
train
java
ed40c1d3a942d6be0199c3bfe75913c4a8d6ba3d
diff --git a/mkdir.js b/mkdir.js index <HASH>..<HASH> 100644 --- a/mkdir.js +++ b/mkdir.js @@ -36,6 +36,14 @@ _mkdir = function (path, options, resolve, reject) { }, reject); } else { stat(path, function (statErr, stats) { + if (statErr) { + if (statErr.code !== 'ENOENT') { + reject(err); + return; + } + _mkdir(path, options, resolve, reject); + return; + } if (statErr || !stats.isDirectory()) reject(err); else resolve(null); });
Address race condition isssue
medikoo_fs2
train
js
79f3d504b99f54d1e8c18205d6fbc5122858151c
diff --git a/reana_commons/version.py b/reana_commons/version.py index <HASH>..<HASH> 100755 --- a/reana_commons/version.py +++ b/reana_commons/version.py @@ -14,4 +14,4 @@ and parsed by ``setup.py``. from __future__ import absolute_import, print_function -__version__ = "0.5.0.dev20190207" +__version__ = "0.5.0.dev20190212"
release: <I>.de<I>
reanahub_reana-commons
train
py
8a3b78ca7bb2bb6af1fe25921cfb5f08fe38325c
diff --git a/patroni/__init__.py b/patroni/__init__.py index <HASH>..<HASH> 100644 --- a/patroni/__init__.py +++ b/patroni/__init__.py @@ -129,7 +129,10 @@ class Patroni(object): signal.signal(signal.SIGTERM, self.sigterm_handler) def shutdown(self): - self.api.shutdown() + try: + self.api.shutdown() + except Exception: + logger.exception('Exception during RestApi.shutdown') self.ha.shutdown() diff --git a/tests/test_patroni.py b/tests/test_patroni.py index <HASH>..<HASH> 100644 --- a/tests/test_patroni.py +++ b/tests/test_patroni.py @@ -151,3 +151,7 @@ class TestPatroni(unittest.TestCase): self.assertTrue(self.p.nosync) self.p.tags['nosync'] = None self.assertFalse(self.p.nosync) + + def test_shutdown(self): + self.p.api.shutdown = Mock(side_effect=Exception) + self.p.shutdown()
Rest api thread can raise an exception during shutdown (#<I>) catch it and report
zalando_patroni
train
py,py