]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/combo-layer: fix dirty repo check
authorPaul Eggleton <paul.eggleton@linux.intel.com>
Wed, 2 Nov 2011 17:20:26 +0000 (17:20 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 7 Nov 2011 13:58:39 +0000 (13:58 +0000)
Fix the dirty repository check to detect any changes, including
untracked files and uncommitted changes in the index.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
scripts/combo-layer

index 4cb9ee072bcf7231a37e6142fa067f2e33e6f86f..f3480dcf5abddfc21108b5d4765746cefec08ab9 100755 (executable)
@@ -138,12 +138,8 @@ def check_repo_clean(repodir):
         check if the repo is clean
         exit if repo is dirty
     """
-    try:
-        runcmd("git diff --quiet", repodir)
-        #TODO: also check the index using "git diff --cached"
-        #      but this will fail in just initialized git repo
-        #      so need figure out a way
-    except:
+    output=runcmd("git status --porcelain", repodir)
+    if output:
         logger.error("git repo %s is dirty, please fix it first", repodir)
         sys.exit(1)