diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2016-08-02 14:25:20 +0100 |
---|---|---|
committer | Thibault Saunier <tsaunier@gnome.org> | 2016-08-09 14:37:25 -0400 |
commit | 38c6376cc8b4ea0f329799a70ba62375a137f774 (patch) | |
tree | a256f6925d66e0aa55eec3f74676498f17bff6b1 | |
parent | 0da87a382f2bc6abecf3136e242ed48295842c74 (diff) |
fetch: Gracefully error if task has no git URI set
Rather than aborting with a string processing exception.
Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D1237
-rwxr-xr-x | git-phab | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1487,9 +1487,12 @@ Paste API Token from that page and press <enter>: """ % self.phabricator_uri) reply = self.phabricator.maniphest.query(ids=[int(self.task[1:])]) - props = list(reply.values())[0] - uri = props['auxiliary']['std:maniphest:git:uri-branch'] - remote, branch = uri.split('#') + try: + props = list(reply.values())[0] + uri = props['auxiliary']['std:maniphest:git:uri-branch'] + remote, branch = uri.split('#') + except: + self.die("Git URI is not set on task; cannot fetch it.") print("Git URI: %s, branch: %s" % (remote, branch)) self.repo.git.fetch(remote, "%s" % branch) |