Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

$ git update-index --chmod +x ./scripts/moveFile.sh

2018-01-28T06:54:31.644Z - error: [ui] `git commit -F -` exited with an unexpected code: 1.
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean

(The error was parsed as 16: There are no changes to commit.)
Comment

$ git update-index --chmod +x ./scripts/moveFile.sh

# branch.oid 47648eb505277e044a5794f97312a5d669d79ca7
# branch.head master
# branch.upstream origin/master
# branch.ab +0 -0
Comment

$ git update-index --chmod +x ./scripts/moveFile.sh

# branch.oid 47648eb505277e044a5794f97312a5d669d79ca7
# branch.head master
# branch.upstream origin/master
# branch.ab +0 -0
1 M. N... 100644 100755 100755 ae2bd1f42ebe4eaf62cc6460765016cffa804247 ae2bd1f42ebe4eaf62cc6460765016cffa804247 test
Comment

$ git update-index --chmod +x ./scripts/moveFile.sh

diff --git a/app/test/unit/git/commit-test.ts b/app/test/unit/git/commit-test.ts
index b5ac688e5..18002c38c 100644
--- a/app/test/unit/git/commit-test.ts
+++ b/app/test/unit/git/commit-test.ts
@@ -33,6 +33,8 @@ import {
 
 import * as fs from 'fs-extra'
 
+import * as Mode from 'stat-mode'
+
 async function getTextDiff(
   repo: Repository,
   file: WorkingDirectoryFileChange
@@ -476,6 +478,51 @@ describe('git/commit', () => {
   })
 
   describe('index corner cases', () => {
+    it('persists the --chmod=+x when set in the index', async () => {
+      let status,
+        files = null
+
+      const repo = await setupEmptyRepository()
+
+      const firstPath = path.join(repo.path, 'script.sh')
+      const secondPath = path.join(repo.path, 'README.md')
+
+      fs.writeFileSync(firstPath, `echo "Hello world!"
`)
+      fs.writeFileSync(secondPath, '# README
')
+
+      // commit the file with some content
+      await GitProcess.exec(['add', '.'], repo.path)
+      await GitProcess.exec(['commit', '-m', 'Initial commit'], repo.path)
+
+      // change the file permission
+      await GitProcess.exec(
+        ['update-index', '--chmod=+x', '--', 'script.sh'],
+        repo.path
+      )
+
+      // modify the other file
+      fs.writeFileSync(secondPath, '# Actually This Is The Readme
')
+
+      status = await getStatus(repo)
+      files = status.workingDirectory.files
+
+      expect(files.length).to.equal(2)
+
+      const toCommit = status.workingDirectory.withIncludeAllFiles(true)
+
+      await createCommit(
+        repo,
+        'commit the chmod and content change',
+        toCommit.files
+      )
+
+      const stat = fs.statSync(firstPath)
+      const mode = new Mode(stat)
+      expect(mode.owner.execute).is.true
+      expect(mode.group.execute).is.true
+      expect(mode.others.execute).is.true
+    })
+
     it('can commit when staged new file is then deleted', async () => {
       let status,
         files = null
Comment

PREVIOUS NEXT
Code Example
Shell :: raspian buster mit uv4l 
Shell :: install coreutils 
Shell :: autocompletion not working in root on kali 
Shell :: terminal linux en windows platzi 
Shell :: brew mac install cargo with toolchain 
Shell :: xrandr non cambia la luminosità 
Shell :: ssh welcome message ubuntu 
Shell :: fenser öffnet sich nicht powreshell 
Shell :: atom disable shelling out for environment 
Shell :: dll create github 
Shell :: write-only cloudtrail event filter aws cli 
Shell :: connect 1password cli to 1pass 
Shell :: how to use uf 
Shell :: dropbox windows powershell remove directory sync 
Shell :: uninstall libxcb 
Shell :: how to make my htdocs folder writable on ubuntu 
Shell :: git get data from the repo 
Shell :: bash search multiple string in on line 
Shell :: fslmaths masking 
Shell :: permission denied: unknown 
Shell :: vim cd cant use variables 
Shell :: Crear repo para git hub 
Shell :: sbatch how submitted location using jobid 
Shell :: how to count size dir with cli linux 
Shell :: get wasmtime 
Shell :: sending to git 
Shell :: gitignore new monified file ? 
Shell :: calcul md5 fichier linux 
Shell :: zsh history by tab 
Shell :: osp it digital solutions 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =