You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

staged-git-files

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

staged-git-files - npm Package Compare versions

Comparing version
1.1.0
to
1.1.1
+28
decode.js
function oct2Decimal(oct) {
oct = parseInt(oct);
var i = 0,
bit,
sum = 0;
do {
bit = oct % 10;
sum += bit * Math.pow(8, i++);
} while ( (oct = ~~(oct / 10)) !== 0 )
return sum;
}
function decode(string) {
string = string.trim();
return string
.replace(/^\"(.+)\"$/, '$1')
// x >= 128 && x <= 255
.replace(/(\\\d{3})+/g, function (_) {
var octArray = _.split('\\').slice(1);
var decArray = octArray.map(function(oct) {
return oct2Decimal(oct);
});
return new Buffer(decArray).toString('utf8');
});
}
module.exports = decode;
+4
-0
# Change Log
## 1.1.1
- Fix bug where chinese files names were returned as unicode ids [#15](https://github.com/mcwhittemore/staged-git-files/pull/15) by [imcuttle](https://github.com/imcuttle)
## 1.1.0

@@ -4,0 +8,0 @@

+1
-1

@@ -15,3 +15,3 @@ var spawn = require("child_process").spawn;

} else {
var command = "git diff-index --cached --name-status";
var command = "git -c core.quotepath=false diff-index --cached --name-status";

@@ -18,0 +18,0 @@ if (filter.indexOf('R') !== -1) {

{
"name": "staged-git-files",
"version": "1.1.0",
"version": "1.1.1",
"devDependencies": {

@@ -5,0 +5,0 @@ "should": "~2.0.1",

@@ -39,3 +39,3 @@ # Staged Git Files

```sh
$ staged-git-files
$ sgf
Added package.json

@@ -42,0 +42,0 @@ Modified readme.md

@@ -216,2 +216,23 @@

it("the staged filename contains chinese", function(done) {
addAndCommitFile(function(err, data) {
if (err) {
done(err);
} else {
var newFileName = '你好世界';
moveFile({
oldFileName: data.filename,
newFileName: newFileName
}, function(err) {
var sgf = newSGF();
sgf(asyncCatch(done, function(results) {
results.length.should.equal(1);
results[0].filename.should.equal(newFileName);
results[0].status.should.equal("Renamed");
}));
});
}
});
});
after(function(done) {

@@ -218,0 +239,0 @@ cleanUp(done);