projects
/
mdk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce5fe89
)
Git fetch returns false when failed
author
Frederic Massart
<fred@moodle.com>
Tue, 6 May 2014 06:11:30 +0000
(14:11 +0800)
committer
Frederic Massart
<fred@moodle.com>
Wed, 7 May 2014 03:11:07 +0000
(11:11 +0800)
lib/fetch.py
patch
|
blob
|
history
lib/git.py
patch
|
blob
|
history
diff --git
a/lib/fetch.py
b/lib/fetch.py
index
b253ec0
..
d9640e2
100644
(file)
--- a/
lib/fetch.py
+++ b/
lib/fetch.py
@@
-59,7
+59,7
@@
class Fetch(object):
git = self.M.git()
logging.info('Fetching %s from %s' % (self.ref, self.repo))
result = git.fetch(remote=self.repo, ref=self.ref)
- if
result[0] != 0
:
+ if
not result
:
raise FetchException('Error while fetching %s from %s' % (self.ref, self.repo))
def _merge(self):
diff --git
a/lib/git.py
b/lib/git.py
index
d3733e3
..
ac89158
100644
(file)
--- a/
lib/git.py
+++ b/
lib/git.py
@@
-144,7
+144,8
@@
class Git(object):
def fetch(self, remote='', ref=''):
cmd = 'fetch %s %s' % (remote, ref)
- return self.execute(cmd)
+ result = self.execute(cmd)
+ return result[0] == 0
def getConfig(self, name):
cmd = 'config --get %s' % name