nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: JanDeDobbeleer/oh-my-posh
Pull request #2001 (2022-03-29 16:44:32)

fix(fish): escape hyperlinks correctly
### Prerequisites

- [x] I have read and understood the `CONTRIBUTING` guide
- [x] The commit message follows the [conventional commits][cc] guidelines
- [x] Tests for the changes have been added (for bug fixes/features)
- [x] Docs have been added / updated (for bug fixes/features)

### Description

<!--TemplateBody-->

<!---

Tips:

If you're not comfortable with working with Git, we're working a guide (https://ohmyposh.dev/docs/contributing_git) to help you out.
Oh My Posh advises GitKraken (https://www.gitkraken.com/invite/nQmDPR9D) as your preferred cross platform Git GUI power tool.

-->

[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary



Patch:
diff --git a/src/.goreleaser.yml b/src/.goreleaser.yml
index b2d322bc..f4382cec 100644
--- a/src/.goreleaser.yml
+++ b/src/.goreleaser.yml
@@ -35,8 +35,6 @@ builds:
         goarch: arm
       - goos: windows
         goarch: arm
-      - goos: darwin
-        goarch: arm64
     hooks:
       post:
       - sh -c "cosign sign-blob --key $COSIGN_KEY_LOCATION {{ .Path }} > dist/{{ .Name }}.sig"
diff --git a/src/color/ansi.go b/src/color/ansi.go
index 7a246b71..309b806d 100644
--- a/src/color/ansi.go
+++ b/src/color/ansi.go
@@ -64,7 +64,7 @@ func (a *Ansi) Init(shellName string) {
 		a.colorTransparent = "%%{\x1b[%s;49m\x1b[7m%%}%s%%{\x1b[0m%%}"
 		a.escapeLeft = "%{"
 		a.escapeRight = "%}"
-		a.hyperlink = "%%{\x1b]8;;%s\x1b\\%%}%s%%{\x1b]8;;\x1b\\%%}"
+		a.hyperlink = "%%{\x1b]8;;%s\x1b\\\\%%}%s%%{\x1b]8;;\x1b\\\\%%}"
 		a.osc99 = "%%{\x1b]9;9;\"%s\"\x1b\\%%}"
 		a.bold = "%%{\x1b[1m%%}%s%%{\x1b[22m%%}"
 		a.italic = "%%{\x1b[3m%%}%s%%{\x1b[23m%%}"
@@ -129,6 +129,9 @@ func (a *Ansi) Init(shellName string) {
 		a.dimmed = "\x1b[2m%s\x1b[22m"
 		a.strikethrough = "\x1b[9m%s\x1b[29m"
 	}
+	if shellName == shell.FISH {
+		a.hyperlink = "\x1b]8;;%s\x1b\\\\%s\x1b]8;;\x1b\\\\"
+	}
 	// common replacement for all shells
 	a.shellReservedKeywords = append(a.shellReservedKeywords, shellKeyWordReplacement{"`", "'"})
 }


Test patch:
diff --git a/src/color/ansi_test.go b/src/color/ansi_test.go
index fe398a35..4ff03af2 100644
--- a/src/color/ansi_test.go
+++ b/src/color/ansi_test.go
@@ -31,7 +31,7 @@ func TestGenerateHyperlinkWithUrl(t *testing.T) {
 		ShellName string
 		Expected  string
 	}{
-		{Text: "[google](http://www.google.be)", ShellName: shell.ZSH, Expected: "%{\x1b]8;;http://www.google.be\x1b\\%}google%{\x1b]8;;\x1b\\%}"},
+		{Text: "[google](http://www.google.be)", ShellName: shell.ZSH, Expected: "%{\x1b]8;;http://www.google.be\x1b\\\\%}google%{\x1b]8;;\x1b\\\\%}"},
 		{Text: "[google](http://www.google.be)", ShellName: shell.PWSH, Expected: "\x1b]8;;http://www.google.be\x1b\\google\x1b]8;;\x1b\\"},
 		{Text: "[google](http://www.google.be)", ShellName: shell.BASH, Expected: "\\[\x1b]8;;http://www.google.be\x1b\\\\\\]google\\[\x1b]8;;\x1b\\\\\\]"},
 	}
Repository: JanDeDobbeleer/oh-my-posh
Pull request #1229 (2021-11-15 09:43:25)

fix: node segment enable_version_mismatch
### Prerequisites

- [x] I have read and understood the `CONTRIBUTING` guide
- [x] The commit message follows the [conventional commits][cc] guidelines
- [x] Tests for the changes have been added (for bug fixes/features)
- [ ] Docs have been added / updated (for bug fixes/features)

### Description

The `.nvmrc` file can contain a node version in [different formats](https://github.com/nvm-sh/nvm#nvmrc), but currently this behavior is not supported. This fix adds more formats of `.nvmrc` file content.

[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary



Patch:
diff --git a/src/segment_node.go b/src/segment_node.go
index 79f76e55..d7436a06 100644
--- a/src/segment_node.go
+++ b/src/segment_node.go
@@ -61,5 +61,13 @@ func (n *node) matchesVersionFile() bool {
 	if len(fileVersion) == 0 {
 		return true
 	}
-	return fileVersion == n.language.activeCommand.version.Full
+
+	regex := fmt.Sprintf(
+		`(?im)^v?%s(\.?%s)?(\.?%s)?$`,
+		n.language.activeCommand.version.Major,
+		n.language.activeCommand.version.Minor,
+		n.language.activeCommand.version.Patch,
+	)
+
+	return matchString(regex, fileVersion)
 }


Test patch:
diff --git a/src/segment_node_test.go b/src/segment_node_test.go
index 637055a4..6b2a8f73 100644
--- a/src/segment_node_test.go
+++ b/src/segment_node_test.go
@@ -7,15 +7,25 @@ import (
 )
 
 func TestNodeMatchesVersionFile(t *testing.T) {
+	nodeVersion := version{
+		Full:  "1.2.3",
+		Major: "1",
+		Minor: "2",
+		Patch: "3",
+	}
 	cases := []struct {
 		Case      string
 		Expected  bool
 		RCVersion string
-		Version   string
 	}{
-		{Case: "no file context", Expected: true, RCVersion: "", Version: "durp"},
-		{Case: "version match", Expected: true, RCVersion: "durp", Version: "durp"},
-		{Case: "version mismatch", Expected: false, RCVersion: "werp", Version: "durp"},
+		{Case: "no file context", Expected: true, RCVersion: ""},
+		{Case: "version match", Expected: true, RCVersion: "1.2.3"},
+		{Case: "version mismatch", Expected: false, RCVersion: "3.2.1"},
+		{Case: "version match in other format", Expected: true, RCVersion: "v1.2.3"},
+		{Case: "version match without patch", Expected: true, RCVersion: "1.2"},
+		{Case: "version match without patch in other format", Expected: true, RCVersion: "v1.2"},
+		{Case: "version match without minor", Expected: true, RCVersion: "1"},
+		{Case: "version match without minor in other format", Expected: true, RCVersion: "v1"},
 	}
 
 	for _, tc := range cases {
@@ -25,9 +35,7 @@ func TestNodeMatchesVersionFile(t *testing.T) {
 			language: &language{
 				env: env,
 				activeCommand: &cmd{
-					version: &version{
-						Full: tc.Version,
-					},
+					version: &nodeVersion,
 				},
 			},
 		}
Repository: JanDeDobbeleer/oh-my-posh
Pull request #1426 (2021-12-13 16:37:22)

fix(git): include al untracked files
relates to #1422

### Prerequisites

- [x] I have read and understood the `CONTRIBUTING` guide
- [x] The commit message follows the [conventional commits][cc] guidelines
- [x] Tests for the changes have been added (for bug fixes/features)
- [x] Docs have been added / updated (for bug fixes/features)

### Description

[Description of the change]

<!---

Tips:

If you're not comfortable with working with Git, we're working a guide (https://ohmyposh.dev/docs/contributing_git) to help you out.
Oh My Posh advises GitKraken (https://www.gitkraken.com/invite/nQmDPR9D) as your preferred cross platform Git GUI power tool.

-->

[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary



Patch:
diff --git a/src/segment_git.go b/src/segment_git.go
index f3c0dff6..b73978be 100644
--- a/src/segment_git.go
+++ b/src/segment_git.go
@@ -224,14 +224,14 @@ func (g *git) getUpstreamIcon() string {
 
 func (g *git) setGitStatus() {
 	addToStatus := func(status string) {
-		if len(status) <= 4 {
-			return
-		}
 		const UNTRACKED = "?"
 		if strings.HasPrefix(status, UNTRACKED) {
 			g.Working.add(UNTRACKED)
 			return
 		}
+		if len(status) <= 4 {
+			return
+		}
 		workingCode := status[3:4]
 		stagingCode := status[2:3]
 		g.Working.add(workingCode)


Test patch:
diff --git a/src/segment_git_test.go b/src/segment_git_test.go
index 842a281e..ee813a68 100644
--- a/src/segment_git_test.go
+++ b/src/segment_git_test.go
@@ -361,6 +361,22 @@ func TestSetGitStatus(t *testing.T) {
 			ExpectedAhead:    2,
 			ExpectedBehind:   1,
 		},
+		{
+			Case: "untracked files",
+			Output: `
+			# branch.oid 1234567891011121314
+			# branch.head main
+			# branch.upstream origin/main
+			# branch.ab +0 -0
+			? q
+			? qq
+			? qqq
+			`,
+			ExpectedUpstream: "origin/main",
+			ExpectedHash:     "1234567",
+			ExpectedRef:      "main",
+			ExpectedWorking:  &GitStatus{ScmStatus: ScmStatus{Added: 3}},
+		},
 	}
 	for _, tc := range cases {
 		env := new(MockedEnvironment)
Repository: JanDeDobbeleer/oh-my-posh
Pull request #5335 (2024-07-23 18:07:13)

fix: correct hyperlinks for Git Bash
### Prerequisites

- [x] I have read and understood the [contributing guide][CONTRIBUTING.md].
- [x] The commit message follows the [conventional commits][cc] guidelines.
- [x] Tests for the changes have been added (for bug fixes / features).
- [x] Docs have been added/updated (for bug fixes / features).

resolves https://github.com/microsoft/terminal/issues/17602

<!---

Tips:

If you're not comfortable with working with Git,
we're working a guide (https://ohmyposh.dev/docs/contributing/git) to help you out.
Oh My Posh advises GitKraken (https://www.gitkraken.com/invite/nQmDPR9D) as your preferred cross platform Git GUI power tool.

-->

[CONTRIBUTING.md]: https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/CONTRIBUTING.md
[cc]: https://www.conventionalcommits.org/en/v1.0.0/#summary


JanDeDobbeleer: I'm fixing the tests but first I need to go and eat an ice cream.

Patch:
diff --git a/src/terminal/writer.go b/src/terminal/writer.go
index 46f2e46c..e0de6995 100644
--- a/src/terminal/writer.go
+++ b/src/terminal/writer.go
@@ -163,9 +163,11 @@ func Pwd(pwdType, userName, hostName, pwd string) string {
 	}
 
 	if strings.HasSuffix(pwd, ":") {
-		pwd += "\\"
+		pwd += `/`
 	}
 
+	pwd = strings.ReplaceAll(pwd, `\`, `/`)
+
 	switch pwdType {
 	case OSC7:
 		return fmt.Sprintf(formats.Osc7, hostName, pwd)


Test patch:
diff --git a/src/prompt/engine_test.go b/src/prompt/engine_test.go
index 00a51038..60671174 100644
--- a/src/prompt/engine_test.go
+++ b/src/prompt/engine_test.go
@@ -69,7 +69,7 @@ func TestPrintPWD(t *testing.T) {
 			Pwd:      `C:\Users\user\Documents\GitHub\oh-my-posh`,
 			Config:   terminal.OSC99,
 			Shell:    shell.BASH,
-			Expected: "\x1b]9;9;C:\\Users\\user\\Documents\\GitHub\\oh-my-posh\x1b\\",
+			Expected: "\x1b]9;9;C:/Users/user/Documents/GitHub/oh-my-posh\x1b\\",
 		},
 	}
Repository: nuxt/nuxt.js
Pull request #6736 (2019-11-27 18:32:22)

fix(nuxt-edge): global name is wrongly set to nuxt-edge
[release]

Fix https://github.com/nuxt/nuxt.js/pull/6733#issuecomment-559126653


Patch:
diff --git a/.eslintrc.js b/.eslintrc.js
index 1d52cfda6..5475196b3 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -15,7 +15,8 @@ module.exports = {
   },
   rules: {
     'no-console': 'error',
-    'no-debugger': 'error'
+    'no-debugger': 'error',
+    quotes: ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }]
   },
   overrides: [{
     files: [ 'test/fixtures/*/.nuxt*/**' ],
diff --git a/packages/config/src/config/_common.js b/packages/config/src/config/_common.js
index ba301d487..a724bbe86 100644
--- a/packages/config/src/config/_common.js
+++ b/packages/config/src/config/_common.js
@@ -12,8 +12,7 @@ export default () => ({
   mode: 'universal',
   modern: undefined,
 
-  // Globals
-  globalName: 'nuxt',
+  globalName: undefined,
   globals: {
     id: globalName => `__${globalName}`,
     nuxt: globalName => `$${globalName}`,
diff --git a/packages/config/src/options.js b/packages/config/src/options.js
index 681b89169..be50a6ed9 100644
--- a/packages/config/src/options.js
+++ b/packages/config/src/options.js
@@ -63,7 +63,8 @@ export function getNuxtConfig (_options) {
 
   options.globalName = (isNonEmptyString(options.globalName) && /^[a-zA-Z]+$/.test(options.globalName))
     ? options.globalName.toLowerCase()
-    : 'nuxt'
+    // use `` for preventing replacing to nuxt-edge
+    : `nuxt`
 
   // Resolve rootDir
   options.rootDir = isNonEmptyString(options.rootDir) ? path.resolve(options.rootDir) : process.cwd()
diff --git a/scripts/package b/scripts/package
index 52bfdaaf1..f008808fa 100755
--- a/scripts/package
+++ b/scripts/package
@@ -4,7 +4,7 @@ import consola from 'consola'
 
 import Package from './package.js'
 
-async function main() {
+async function main () {
   // Read package at current directory
   const rootPackage = new Package()
   const workspacePackages = await rootPackage.getWorkspacePackages()


Test patch:
diff --git a/packages/config/test/config/__snapshots__/index.test.js.snap b/packages/config/test/config/__snapshots__/index.test.js.snap
index c9f4e08a4..5d33926ac 100644
--- a/packages/config/test/config/__snapshots__/index.test.js.snap
+++ b/packages/config/test/config/__snapshots__/index.test.js.snap
@@ -177,7 +177,7 @@ Object {
     "routes": Array [],
     "subFolders": true,
   },
-  "globalName": "nuxt",
+  "globalName": undefined,
   "globals": Object {
     "context": [Function],
     "id": [Function],
@@ -531,7 +531,7 @@ Object {
     "routes": Array [],
     "subFolders": true,
   },
-  "globalName": "nuxt",
+  "globalName": undefined,
   "globals": Object {
     "context": [Function],
     "id": [Function],