1

I'm running git clean -fdx as a sh step in a Jenkins job, and the command sometimes exits with code 1 (after deleting a bunch of files+directories). What could be causing it?

This is on Linux, so it's not a matter of another process keeping a file open. There is no error output, unless Jenkins is hiding it.

Dan Berindei
  • 7,054
  • 3
  • 41
  • 48
  • Permission issue perhaps? – spectras Aug 25 '17 at 14:27
  • 1
    Can you run it manually from the same clone to make sure there is no output? Or redirect the output to a file in `/tmp` for later inspection? – Thomas Aug 25 '17 at 14:28
  • Possible duplicate of [TortoiseGit-git did not exit cleanly (exit code 1)](https://stackoverflow.com/questions/22165953/tortoisegit-git-did-not-exit-cleanly-exit-code-1) – Mureinik Aug 25 '17 at 14:30
  • @Mureinik All the answers in https://stackoverflow.com/questions/22165953/tortoisegit-git-did-not-exit-cleanly-exit-code-1 seem to be Windows-related – Dan Berindei Aug 31 '17 at 10:00

1 Answers1

1

Turns out another process was creating files after git-clean enumerated an ignored directory and before it deleted all the subdirectories, so rmdir() returned ENOTEMPTY.

Dan Berindei
  • 7,054
  • 3
  • 41
  • 48