Commit 9da095e9 authored by Kai Willadsen's avatar Kai Willadsen

Set the cwd when checking repository validity (closes bgo#650250)

parent d67b8620
......@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc):
def resolved_command(self):
return [self.CMD] + self.CMDARGS + ["resolve"]
def valid_repo(self):
if _vc.call([self.CMD, "check", "--tree", "--branch"]):
if _vc.call([self.CMD, "check", "--tree", "--branch"], cwd=self.root):
return False
else:
return True
......
......@@ -57,7 +57,7 @@ class Vc(_vc.Vc):
def revert_command(self):
return [self.CMD,"update","-C"]
def valid_repo(self):
if _vc.call([self.CMD, "version"]):
if _vc.call([self.CMD, "version"], cwd=self.root):
return False
else:
return True
......
......@@ -71,7 +71,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "resolve"]
def valid_repo(self):
if _vc.call([self.CMD, "query", "tags"]):
if _vc.call([self.CMD, "query", "tags"], cwd=self.root):
return False
else:
return True
......
......@@ -63,7 +63,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "revert"]
def valid_repo(self):
if _vc.call([self.CMD, "info"]):
if _vc.call([self.CMD, "info"], cwd=self.root):
return False
else:
return True
......
......@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc):
def revert_command(self):
return [self.CMD,"checkout"]
def valid_repo(self):
if _vc.call([self.CMD, "branch"]):
if _vc.call([self.CMD, "branch"], cwd=self.root):
return False
else:
return True
......@@ -83,7 +83,8 @@ class Vc(_vc.CachedVc):
try:
# Update the index before getting status, otherwise we could
# be reading stale status information
_vc.popen(["git", "update-index", "--refresh"])
_vc.popen(["git", "update-index", "--refresh"],
cwd=self.location)
# Get the status of files that are different in the "index" vs
# the HEAD of the git repository
......
......@@ -60,7 +60,7 @@ class Vc(_vc.Vc):
def revert_command(self):
return [self.CMD,"revert"]
def valid_repo(self):
if _vc.call([self.CMD, "root"]):
if _vc.call([self.CMD, "root"], cwd=self.root):
return False
else:
return True
......
......@@ -144,7 +144,7 @@ class Vc(_vc.CachedVc):
def resolved_command(self):
return [self.CMD,"resolved"]
def valid_repo(self):
if _vc.call([self.CMD, "list", "tags"]):
if _vc.call([self.CMD, "list", "tags"], cwd=self.root):
return False
else:
return True
......
......@@ -65,7 +65,7 @@ class Vc(_vc.CachedVc):
def resolved_command(self):
return [self.CMD,"resolved"]
def valid_repo(self):
if _vc.call([self.CMD, "info"]):
if _vc.call([self.CMD, "info"], cwd=self.root):
return False
else:
return True
......
......@@ -86,7 +86,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "undo", "--"]
def valid_repo(self):
if _vc.call([self.CMD, "tree-version"]):
if _vc.call([self.CMD, "tree-version"], cwd=self.root):
return False
else:
return True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment