From 7c2ee0f7141405c0c739518ce3997003708efcf2 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Thu, 3 Feb 2011 17:56:41 -0500 Subject: [PATCH] Fix detection of whether git-stash is needed. I broke the code that determines whether git-stash is determined in commit 2b0d0d62481880ffc1e1f0e4820f2944b78610d3. The problem is that the system() Perl function returns the exit code and miscellaneous process exit data (such as whether the process failed to run, etc.) and I actually needed that data. In the commit I refer to, I switched to my safe_system() which only returns the exit code and now kdesrc-build thought there was an error running git, when instead git was returning the proper exit code for a module with local changes. Thanks to dfaure for the report. Not closing the bug here in case I merge this somewhere else later. CCBUG:265325 --- kdesrc-build | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kdesrc-build b/kdesrc-build index 6b4357d..5d47f82 100755 --- a/kdesrc-build +++ b/kdesrc-build @@ -1992,7 +1992,8 @@ sub git_stash_and_update # To find out if we should stash, we just use git diff --quiet, twice to # account for the index and the working dir. - my $status = safe_system('git', 'diff', '--quiet'); + # Note: Don't use safe_system, as the error code is stripped to the exit code + my $status = pretending() ? 0 : system('git', 'diff', '--quiet'); if ($status == -1 || $status & 127) { die make_exception('Runtime', @@ -2006,7 +2007,7 @@ sub git_stash_and_update $needsStash = 1; } else { - $status = safe_system('git', 'diff', '--cached', '--quiet'); + $status = pretending() ? 0 : system('git', 'diff', '--cached', '--quiet'); if ($status == -1 || $status & 127) { die make_exception('Runtime', "$module doesn't appear to be a git module when" .