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): ...@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc):
def resolved_command(self): def resolved_command(self):
return [self.CMD] + self.CMDARGS + ["resolve"] return [self.CMD] + self.CMDARGS + ["resolve"]
def valid_repo(self): 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 return False
else: else:
return True return True
......
...@@ -57,7 +57,7 @@ class Vc(_vc.Vc): ...@@ -57,7 +57,7 @@ class Vc(_vc.Vc):
def revert_command(self): def revert_command(self):
return [self.CMD,"update","-C"] return [self.CMD,"update","-C"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "version"]): if _vc.call([self.CMD, "version"], cwd=self.root):
return False return False
else: else:
return True return True
......
...@@ -71,7 +71,7 @@ class Vc(_vc.CachedVc): ...@@ -71,7 +71,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "resolve"] return [self.CMD, "resolve"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "query", "tags"]): if _vc.call([self.CMD, "query", "tags"], cwd=self.root):
return False return False
else: else:
return True return True
......
...@@ -63,7 +63,7 @@ class Vc(_vc.CachedVc): ...@@ -63,7 +63,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "revert"] return [self.CMD, "revert"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "info"]): if _vc.call([self.CMD, "info"], cwd=self.root):
return False return False
else: else:
return True return True
......
...@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc): ...@@ -67,7 +67,7 @@ class Vc(_vc.CachedVc):
def revert_command(self): def revert_command(self):
return [self.CMD,"checkout"] return [self.CMD,"checkout"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "branch"]): if _vc.call([self.CMD, "branch"], cwd=self.root):
return False return False
else: else:
return True return True
...@@ -83,7 +83,8 @@ class Vc(_vc.CachedVc): ...@@ -83,7 +83,8 @@ class Vc(_vc.CachedVc):
try: try:
# Update the index before getting status, otherwise we could # Update the index before getting status, otherwise we could
# be reading stale status information # 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 # Get the status of files that are different in the "index" vs
# the HEAD of the git repository # the HEAD of the git repository
......
...@@ -60,7 +60,7 @@ class Vc(_vc.Vc): ...@@ -60,7 +60,7 @@ class Vc(_vc.Vc):
def revert_command(self): def revert_command(self):
return [self.CMD,"revert"] return [self.CMD,"revert"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "root"]): if _vc.call([self.CMD, "root"], cwd=self.root):
return False return False
else: else:
return True return True
......
...@@ -144,7 +144,7 @@ class Vc(_vc.CachedVc): ...@@ -144,7 +144,7 @@ class Vc(_vc.CachedVc):
def resolved_command(self): def resolved_command(self):
return [self.CMD,"resolved"] return [self.CMD,"resolved"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "list", "tags"]): if _vc.call([self.CMD, "list", "tags"], cwd=self.root):
return False return False
else: else:
return True return True
......
...@@ -65,7 +65,7 @@ class Vc(_vc.CachedVc): ...@@ -65,7 +65,7 @@ class Vc(_vc.CachedVc):
def resolved_command(self): def resolved_command(self):
return [self.CMD,"resolved"] return [self.CMD,"resolved"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "info"]): if _vc.call([self.CMD, "info"], cwd=self.root):
return False return False
else: else:
return True return True
......
...@@ -86,7 +86,7 @@ class Vc(_vc.CachedVc): ...@@ -86,7 +86,7 @@ class Vc(_vc.CachedVc):
return [self.CMD, "undo", "--"] return [self.CMD, "undo", "--"]
def valid_repo(self): def valid_repo(self):
if _vc.call([self.CMD, "tree-version"]): if _vc.call([self.CMD, "tree-version"], cwd=self.root):
return False return False
else: else:
return True 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