PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: hub4j/github-api (java)

Issue:
GHEvent enum is missing branch_protection_rule
**Describe the bug**
We are seeing this issue when Jenkins is receiving a **branch_protection_rule** webhook event, which is rejected with error "Error 400 Hook should contain event type"
Drilling down to [this piece of code](https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHEvent.java#L12), seems branch_protection_rule is missing from GHEvents enum.

**Expected behavior**
No error 400 is returned when receiving a GitHub branch_protection_rule event

**Additional context**
I can provide corresponding PR, just would need some guidance reg. scope of the change.
Is it only a matter of adding BRANCH_PROTECTION_RULE into GHEvent?

Pull request:
Add support for GitHub event branch_protection_rule
# Description
Add support for GitHub event _branch_protection_rule_
Fixes #1297 
Note i had a first look at [GHEventPayload.java](https://github.com/hub4j/github-api/blob/main/src/main/java/org/kohsuke/github/GHEventPayload.java) but i don't know how to fully add the payload for this event (seems it also needs a new event class)

# Before submitting a PR:
We love getting PRs, but we hate asking people for the same basic changes every time.

- [X] Push your changes to a branch other than `main`. Create your PR from that branch.
- [ ] Add JavaDocs and other comments
- [X] Write tests that run and pass in CI. See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to capture snapshot data.
- [ ] Run `mvn -D enable-ci clean install site` locally. If this command doesn't succeed, your change will not pass CI.

# When creating a PR: 

- [X] Fill in the "Description" above.
- [X] Enable "Allow edits from maintainers".


Patch:
diff --git a/src/main/java/org/kohsuke/github/GHEvent.java b/src/main/java/org/kohsuke/github/GHEvent.java
index 12f408be0..29baf21fc 100644
--- a/src/main/java/org/kohsuke/github/GHEvent.java
+++ b/src/main/java/org/kohsuke/github/GHEvent.java
@@ -10,6 +10,7 @@ import java.util.Locale;
  * @see <a href="https://developer.github.com/v3/activity/events/types/">Event type reference</a>
  */
 public enum GHEvent {
+    BRANCH_PROTECTION_RULE,
     CHECK_RUN,
     CHECK_SUITE,
     CODE_SCANNING_ALERT,


Test patch:
diff --git a/src/test/java/org/kohsuke/github/EnumTest.java b/src/test/java/org/kohsuke/github/EnumTest.java
index 1d36b5e03..ac85708e4 100644
--- a/src/test/java/org/kohsuke/github/EnumTest.java
+++ b/src/test/java/org/kohsuke/github/EnumTest.java
@@ -28,7 +28,7 @@ public class EnumTest extends AbstractGitHubWireMockTest {
 
         assertThat(GHDirection.values().length, equalTo(2));
 
-        assertThat(GHEvent.values().length, equalTo(62));
+        assertThat(GHEvent.values().length, equalTo(63));
         assertThat(GHEvent.ALL.symbol(), equalTo("*"));
         assertThat(GHEvent.PULL_REQUEST.symbol(), equalTo(GHEvent.PULL_REQUEST.toString().toLowerCase()));
Repository: analysis-dev/diktat (kotlin)

Issue:
`Update metrics` workflow fails after SAVE has been integrated
In `build_and_test` we started to build the project in two passes: build jars and then run tests, because SAVE requires pre-built JAR. However, we haven't updated `metrics_for_master.yml` workflow the same way

Pull request:
### What's done:
* updated metrics
Closes #1461

Patch:
diff --git a/.github/workflows/metrics_for_master.yml b/.github/workflows/metrics_for_master.yml
index f31fbeacab..155cb76d7c 100644
--- a/.github/workflows/metrics_for_master.yml
+++ b/.github/workflows/metrics_for_master.yml
@@ -28,9 +28,11 @@ jobs:
           key: maven-build-${{ hashFiles('**/pom.xml') }}
           restore-keys: |
             maven-build-
-      - name: Run tests
+      - name: Maven Install
         # we need to run `install` goal here so that gradle will be able to resolve dependencies and run tests on diktat-gradle-plugin
-        run: mvn -B install -DskipPluginMarker
+        run: mvn -B install -DskipPluginMarker -DskipTests
+      - name: Run tests
+        run: mvn verify
       - name: Generate code coverage report
         uses: codecov/codecov-action@v3
         with:


Test patch:
diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml
index 330224f782..939765f846 100644
--- a/.github/workflows/build_and_test.yml
+++ b/.github/workflows/build_and_test.yml
@@ -26,7 +26,7 @@ jobs:
       - name: Maven Install
         run: mvn -B clean install -DskipTests
       - name: Maven run test
-        run: mvn test
+        run: mvn verify
       - name: Code coverage report
         uses: codecov/codecov-action@v3
         with:
@@ -158,7 +158,7 @@ jobs:
       - name: Maven run test
         if: ${{ runner.os == 'Linux' || runner.os == 'macOS' }}
         run: |
-          mvn test
+          mvn verify
         shell: bash
 
       - name: Maven Install on windows
@@ -170,7 +170,7 @@ jobs:
       - name: Maven run test
         if: runner.os == 'Windows'
         run: |
-          mvn test
+          mvn verify
         shell: cmd
 
         # This step needs a Git repository, so it's impossible to extract it
Repository: kkawakam/rustyline (rust)

Issue:
Crash at rustyline-11.0.0/src/keymap.rs:205:18
Hi, 

when I have rustyline configured the following way:


```
 let config_builder = rustyline::config::Config::builder()
  .max_history_size(10000)?
  .history_ignore_dups( true)?
  .auto_add_history(true)
  .bell_style(rustyline::config::BellStyle::None)
  .completion_type(rustyline::config::CompletionType::List)
  .edit_mode( rustyline::EditMode::Vi);

 let config = config_builder.build();

```

(note that vi mode is active)

Later on I am in the commandline via:

`rl.readline(">> ");`

And I press 'ESC' (so I am in the command mode of the vi mode)
and then I press '.' then it crashes.

`>> thread 'main' panicked at 'internal error: entered unreachable code', .../.cargo/registry/src/github.com-1ecc6299db9ec823/rustyline-11.0.0/src/keymap.rs:205:18`

'.' in the vi mode is the repetition of the latest command but in this situation there was no latest command yet.

Regards,
Frank Schwidom



Pull request:
Fix dot command in vi mode
Fix #705

Patch:
diff --git a/src/keymap.rs b/src/keymap.rs
index 025ea97..20ab049 100644
--- a/src/keymap.rs
+++ b/src/keymap.rs
@@ -711,7 +711,9 @@ impl<'b> InputState<'b> {
             E(K::Char('$') | K::End, M::NONE) => Cmd::Move(Movement::EndOfLine),
             E(K::Char('.'), M::NONE) => {
                 // vi-redo (repeat last command)
-                if no_num_args {
+                if !self.last_cmd.is_repeatable() {
+                    Cmd::Noop
+                } else if no_num_args {
                     self.last_cmd.redo(None, wrt)
                 } else {
                     self.last_cmd.redo(Some(n), wrt)


Test patch:
diff --git a/src/test/vi_cmd.rs b/src/test/vi_cmd.rs
index c8ff89b..9971562 100644
--- a/src/test/vi_cmd.rs
+++ b/src/test/vi_cmd.rs
@@ -13,10 +13,15 @@ fn dollar() {
     );
 }
 
-/*#[test]
+#[test]
 fn dot() {
-    // TODO
-}*/
+    assert_cursor(
+        EditMode::Vi,
+        ("", ""),
+        &[E::ESC, E::from('.'), E::ENTER],
+        ("", ""),
+    );
+}
 
 #[test]
 fn semi_colon() {
Repository: otiai10/copy (go)

Issue:
Option to preserve special files
Similar to `rsync --specials` an option to handle special files as special is required: Currently the code tries to always copy the *content* of such files, e.g. `/dev/console`, pipes, sockets, … instead of copying it as a special files.
This is causing `kaniko` to stall when building base images: https://github.com/GoogleContainerTools/kaniko/issues/960

Pull request:
Skip device files by default: Use opt.Specials
Fix #78

Patch:
diff --git a/copy.go b/copy.go
index 81e1ecc..7ec6394 100644
--- a/copy.go
+++ b/copy.go
@@ -26,6 +26,11 @@ func Copy(src, dest string, opt ...Options) error {
 // switchboard switches proper copy functions regarding file type, etc...
 // If there would be anything else here, add a case to this switchboard.
 func switchboard(src, dest string, info os.FileInfo, opt Options) (err error) {
+
+	if info.Mode()&os.ModeDevice != 0 && !opt.Specials {
+		return err
+	}
+
 	switch {
 	case info.Mode()&os.ModeSymlink != 0:
 		err = onsymlink(src, dest, opt)
diff --git a/options.go b/options.go
index 0045813..22cd958 100644
--- a/options.go
+++ b/options.go
@@ -14,6 +14,9 @@ type Options struct {
 	// Skip can specify which files should be skipped
 	Skip func(src string) (bool, error)
 
+	// Specials includes special files to be copied. default false.
+	Specials bool
+
 	// AddPermission to every entities,
 	// NO MORE THAN 0777
 	// @OBSOLETE
@@ -90,6 +93,7 @@ func getDefaultOptions(src, dest string) Options {
 		AddPermission:     0,                  // Add nothing
 		PermissionControl: PerservePermission, // Just preserve permission
 		Sync:              false,              // Do not sync
+		Specials:          false,              // Do not copy special files
 		PreserveTimes:     false,              // Do not preserve the modification time
 		CopyBufferSize:    0,                  // Do not specify, use default bufsize (32*1024)
 		intent: struct {


Test patch:
diff --git a/all_test.go b/all_test.go
index b77a182..47896ec 100644
--- a/all_test.go
+++ b/all_test.go
@@ -195,6 +195,13 @@ func TestOptions_Skip(t *testing.T) {
 	})
 }
 
+func TestOptions_Specials(t *testing.T) {
+	if runtime.GOOS == "linux" || runtime.GOOS == "darwin" {
+		err := Copy("/dev/null", "test/data.copy/dev-null", Options{Specials: false})
+		Expect(t, err).ToBe(nil)
+	}
+}
+
 func TestOptions_PermissionControl(t *testing.T) {
 	info, err := os.Stat("test/data/case07/dir_0555")
 	Expect(t, err).ToBe(nil)