Skip to content

Commit

Permalink
Fixed bug when checking if a git repo contains a commit
Browse files Browse the repository at this point in the history
Conflicts:
	webrtc/sync_chromium.py
  • Loading branch information
Mitchell Wills committed Jun 22, 2015
1 parent deaa695 commit 39e8228
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion webrtc/sync_chromium.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def lookupChromiumHook(name):
dep_destination = os.path.join(CHROMIUM_SRC_DIR, name)

if not os.path.isdir(dep_destination):
print name + " does not exist, cloning: " + dep_repo
subprocess.check_call(["git", "clone", "-q", dep_repo, dep_destination])
subprocess.check_call(["git", "config", "remote.origin.fetch",
"+refs/branch-heads/*:refs/remotes/branch-heads/*",
Expand All @@ -191,7 +192,7 @@ def lookupChromiumHook(name):

current_revision = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=dep_destination).strip()
if current_revision != dep_revision:
if subprocess.call(["git", "rev-parse", dep_revision], cwd=dep_destination, stdout=dev_null, stderr=dev_null) != 0:
if subprocess.call(["git", "show", dep_revision], cwd=dep_destination, stdout=dev_null, stderr=dev_null) != 0: # will fail if commit does not exist
print "Could not find requested commit: "+dep_revision+", fetching"
subprocess.check_call(["git", "fetch", "-q", "--all"], cwd=dep_destination)
print "Checking out: " + dep_revision + ' for ' + name
Expand Down

0 comments on commit 39e8228

Please sign in to comment.